Need to write a custom function on Edx next unit button

Hi,

I want to write a custom function on the unit navigation buttons on studio and lms of Edx. Is there a way to do this and have it reflected in the entire environment?

Thanks