Extending a zurb foundation 5.5.3 javascript plugin

Hi! I am trying to find out how to modify the foundation 5.5.3 javascript plugin Foundation.libs.topbar without forking it. There I need to modify one of the callbacks in the events function. I wrote a detailed question on stackoverflow (https://stackoverflow.com/q/63564173/11447859) about it, sadly i had bad luck in getting any answers so far.

Can anybody point me in the right direction please?

Probably possible by using the prototype and overwriting the needed method or property.

Or if you use npm try the patch-package package.