Increase a variable when damage is recived

Hello.
I'll get to the point. My idea is to have a common party bar in battle that starts from 0 and increases when an actor recives damage. Then when it is full the player can press a button to "release the energy" (quite like omori, but i would use the "key pressed" conditional branch if it's avaiable in battle).
Now, i know how to make a bar with events, and i bypassed all the battle scene limitations with a global common event script by tsukihime. The issue comes to increase the variable every time the actor recives damage, no clue about how to do this. Some ideas?

Original thread: https://forums.rpgmakerweb.com/threads/increase-a-variable-when-damage-is-recived.137682/