How to check if enemy missed an attack and make it activate a state.

I want to make a passive state where it checks for if the enemy missed and if they did it actives another state that gives you 100% evasion rate. But it the passive stat shouldn't reactiave if they missed because of the Evasion State. The problems i have.
1. How to check if the enemy missed with a state.
2. How to make evasion 100% on a person, the parameter trait didn't work.
3. For the passive state not to register a miss if its caused by the Evasion state mentioned earlier.
--------
Honesty idk if this is possible I haven't seen any threads talk about this.
Hmmm, I think it's like:

<Custom Deselect Effect>
if (target.result().missed && !target.isStateAffected(evasion state id)) {
target.addState(evasion state id);
}
</Custom Deselect Effect>

Did you check that the attacks the evasion didn't work against were physical attacks? Or did you change how hit-evasion works with a plugin?
ok the thing notetag works and i used physical attack now and it worked.
Thanks

Original thread: https://forums.rpgmakerweb.com/threads/how-to-check-if-enemy-missed-an-attack-and-make-it-activate-a-state.177370/