Common event before calling menu

Hello, is is possible to run a certain common event right BEFORE the menu comes up after pressing ESC?
I still want the menu to show up it's that there are a few things that should happen before that. Is something like this possible?
it's possible, but also require WHAT should happen before.

as when the menu open, everything freezes around it, and
without knowing what should happen before is hard to tell if
it's recommended or not.
it's possible, but also require WHAT should happen before.

as when the menu open, everything freezes around it, and
without knowing what should happen before is hard to tell if
it's recommended or not.

What I want to do is to delete a picture right before the menu comes up.
and show again when the menu is closed?

if so, it is best to have a plugin, and the easiest is either
YEP_ButtonCommonEvents or Eli_ButtonCommonEvents as both require
the core, Eli ButtonCommonEvents seems to be free, YEP is paid.

in the parameter, set X to common Event ID, there, you can erase the
picture ID, turn menu open, and if needed, do things after it.

Eli also have menu quit to run a common event, but without plugin
might be doable, but require a parallel process to check if the X is being
pressed in order delete the picture (which isn't a good thing to do).
The common event can have "stuff" after the menu is show and they will process after the menu is closed.

i show a picture before the menu pops and delete it when the menu closes so its proven that the event will run in its entirety it will just pause while the menu runs its own processes so:

delete picture
show menu
show picture

should work in that order regardless of how manu sub menus you open and close.

Original thread: https://forums.rpgmakerweb.com/threads/common-event-before-calling-menu.148782/