(CLOSED) Need state that vanishes when enemy attack is evaded

(Please let me know if this is in the wrong forum.)

I'm trying to make a skill in my game that causes the user to avoid any one enemy attack automatically, after which evade rates are set back to normal.

The "avoiding the attack" part is easy enough- just add 100% EVA and MEV- but I'm having trouble finding any means to remove the state when the first attack misses, script-based or otherwise. Does anyone know of any way to cause a specific state to vanish when an attack is evaded?

Any help is appreciated.
The easiest way to go about it would just to set the state's duration to a turn or two. I get what your getting at but you'd need a script to do what you want to do and idk where to point ya.
You'd need a script for that... You could probably use yanfly's lunatic state.
I figured it out! Just had to tweak item_apply like so:

class Game_Battler < Game_BattlerBase def item_apply(user, item) @result.clear @result.used = item_test(user, item) @result.missed = (@result.used && rand >= item_hit(user, item)) @result.evaded = ([email protected] && rand < item_eva(user, item)) if @result.hit? unless item.damage.none? @result.critical = (rand < item_cri(user, item)) make_damage_value(user, item) execute_damage(user) end item.effects.each {|effect| item_effect_apply(user, item, effect) } item_user_effect(user, item) end #The next three lines are the code that was added if @result.evaded remove_state([NUMBER]) end endendI put this in a new script, replacing [NUMBER] with the state ID. Now the state automatically removes when an attack is evaded.

Thanks for the suggestions all =) 

Original thread: https://forums.rpgmakerweb.com/threads/closed-need-state-that-vanishes-when-enemy-attack-is-evaded.44170/