Common event during battle equip command?

I'm using a lot of Yanfly's scripts, in this case the command equip script. I'm trying to make it so that when the command equip window closes, it calls a common event that adjusts the actor's HP and MP if they equipped something that changed certain 'crystal stats' from another script.

How it works right now is-
*Player opens equip in battle to change equip
*Equips or unequips vit/spr gear.
*Closes window, a common event is called in the commandequip script, but no change in HP or MP.
*Inputs command, resolves. (RogueDeus AP script for initiative based battle, long story.)
*HP/MP changes take effect.

I'm trying to make it so that once the window closes, the HP/MP changes take effect immediately. Ultimately it's just so much QOL for the player, but it'd be a nice thing to accomplish.

Failing that, is there a way to alter how HP is calculated via script so that xstat.vit*level is added to the base HP?
Moved to: RGSSx Script Support
Common events aren't called until you leave the menu, so that's probably why. How do you have your common event set up?
Parallel process depending on switch 555. The switch is shut off at the end of the event so it doesn't make the game lag.

Okay, so common events aren't called until the menu window closes. Is there a way to futz with the base HP and MP formulas so that they adjust when xstat.vit and xstat.spr are altered?
Okay for the sake of pruning redundant topics and helping anyone else who wants to do this stuff, someone named Hinola helped me find where to make the alterations. In Yanfly's equipment stats script.

Attached is the script in question, with the new adjustments indicated in the red box. As the player is allowed to choose what they increase each level up (strength, vitality, agility, speed, magic, or spirit) and vitality determines both HP and Armor, it's a neat little thing I wanted to include.

As this problem is solved, this topic can be closed and archived when ready.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/common-event-during-battle-equip-command.117246/