Improved Guard status

Hi Friends, I am trying to make a improved Guard status: if the character got hit by energy in this guard turn, he/she gets a buff/status that improves his/her ATK for next turn.

Initially I thought it should be EASY but I looked at the system setting and even checked the passive status plugin from Yanfly, I still have no idea how to make it come true. I appreciate you help or hint if you have any idea. Thanks!

I've moved this thread to Plug-In Support. Thank you.



How do I questions go under the appropriate maker, but since I see no way to do this without a plug-in of some sort I'll move it to Plug-in Support too. Game Mechanics Design is for ideas and if it should be done, not how do I ?
Moved to: Plug-In Support

How do I questions go under the appropriate maker, but since I see no way to do this without a plug-in of some sort I'll move it to Plug-in Support too. Game Mechanics Design is for ideas and if it should be done, not how do I ?
Okay. Thank you for the moving.
Hi everyone, I made a rough version which can achieve my design somehow - but not perfectly:

Code:
<Custom Apply Effect>
var GetHit = 0;
</Custom Apply Effect>

<Custom Respond Effect>
// Check if the target took any HP damage.
if (target.result().hpDamage > 0) {
GetHit = 1;
user.startAnimation(88);}
</Custom Respond Effect>

<Custom Remove Effect>
// Check if the target got hit.
if (GetHit > 0) {
user.addState(71);}
GetHit = 0;
</Custom Remove Effect>

Two problems there: 1. The touch with energy is identified by damage value. So if energy's attack gets missed, it won't trigger the buff.
2. The buff can not be added in real-time. Only be effective when this turn ends.

Any hint to improve? Thanks.

Original thread: https://forums.rpgmakerweb.com/threads/improved-guard-status.106779/