Reacting just once when a state is inflicted during a battle

There's a problem I don't really know how to fix.

During a boss battle, one of the heroes may be attacked with a spell that temporarily blinds them. I'd like them to say something along the lines of 'Ahhh, I can't see anything!', but only at the end of the turn during which the state is inflicted, and not also at the end of every turn in which the character is still blinded.

This is what I tried: I set a battle event that checks whether or not the hero is affected by the state; if they are, then the dialogue box with their reaction shows up. The problem is that...
  • if the span of the event is set on 'Battle', it never runs;
  • if the span of the event is set on 'Turn', it runs every single time a new turn begins and the hero is still affected by the state.
What should I do to have the event be activated only once?
Use an if statement, and a switch to make sure it only plays once.

if (x is affected by y)
if (switch is OFF)
"I'm blinded!"
turn switch ON
end
end
^^ Just make sure that the switches are then reset afterwards for the next battle.
It worked! Thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/reacting-just-once-when-a-state-is-inflicted-during-a-battle.89900/