MV Help on making a state involving dodging.

Hi again, I’m currently trying to make a state that lets you dodge a single hit before turning itself off.

An example would be Luminescent Mirage from Shin Megami Tensei V. it adds a buff that lets you dodge a single move before expiring.

I was wondering if this was possible to replicate in MV by using Yanfly’s States & Buffs.

​

Just give the state a trait with 100% evasion, then a notetag that gets rid of it after an attack.

Code:
<Custom Deselect Effect>
// Was it a Physical Hit, and not beneficial?
if (this.isPhysical() && this.isDamage())
    target.removeState(stateId);
</Custom Deselect Effect>
Thank you again, please enjoy whatever time it is for you and once again thank you for helping me.
This thread is closed due to being reported as solved. If you need it reopened, report the thread to let us know. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/help-on-making-a-state-involving-dodging.173233/