Alternatives to the Bootstrap event ”hidden.bs.modal”

I have problems with importing bootstrap in my JS file so i need to find an alternative to the event “hidden.bs.modal”. I need it to use it just like in this W3school example

I also need to find an alternative to the event “shown.bs.modal”.

More precisely my code is:

document.addEventListener('DOMContentLoaded', function() {
    document.getElementById('deadpool').addEventListener('hidden.bs.modal', event => {
        document.getElementById('byebye').pause();
    });

    document.getElementById('deadpool').addEventListener('shown.bs.modal', event => {
        document.getElementById('byebye').play();
    });
});

where byebye is the id of an audio file and deadpool is the id of the modal.