Reply button custom behavior

I would like to customize the behavior of the Reply button, like passing extra classes or data attributes (for a popover).

I think I’ve narrowed that functionality to this function https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/widgets/post-menu.js.es6#L226.

I’m overriding the whole file and extending the function above with what I want, but I don’t like the idea of keeping this file synced with master. Is there a better way to do this?

Thanks!