Modify esp-idf functions and use in mgos project

My goal is to modify existing esp-idf functions and to use the modified functions in an mgos project.

In my specific example I am trying to modify the mcpwm module to output a single pulse of configurable duration, and to manually retrigger every time I need the pulse.
So for example, I would want to modify esp_err_t mcpwm_init() to not include mcpwm_start(mcpwm_num, timer_num); and similar changes. Since variables such as ‘static mcpwm_context_t context[SOC_MCPWM_GROUPS]’ are defined and used in esp-idf mcpwm.c, I suspect I have to do any changes at the idf level?
I would also like to be able access lower level hardware functions, eg static inline void mcpwm_ll_timer_set_peak() in mcpwm_ll.h.

I have little insight as to how to achieve this, is anybody able to point me in the right direction?

I have seen Mongoose OS with ESP-IDF?, but that seems to be about adding modules that exist in esp-idf to a mongoose project, without modification.

Thanks