how to make it so cancel temporarily doesn't open pause

I made a custom ui using picture common events and im trying to make it so when you press cancel the UI closes, the problem is when I do that the puase menu shows up instead. Any ideas?
1664295483627.png
Isn't there an event command to disable/enable the menu?

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-it-so-cancel-temporarily-doesnt-open-pause.151595/