Making a Switch that is Off From Start of Attack Animation to End of Damage Popup

For scripting purposes I need a switch that can be off (or on -- it doesn't matter specifically) from the start of any given attack animation until the end of that specific attack's damage popup. This is because I have events in my battle that can happen at any time, no matter the phase of the fight (while command entry is happening, during player turns, during enemy turns, etc.). After plenty of prototyping, that part works flawlessly -- with the one glaring exception being that it can interrupt attacks/skills by taking place between attack animations and their associated damage popups (which ends up being confusing and flow-breaking). By having a switch that demarcates the stretch of time between attack animations and damage popups, I can pretty easily prevent it from doing that.

Unfortunately making moves execute common events or flip switches happens before damage popups, to my knowledge, so I don't think that'd work. Any ideas? Any plugins I haven't heard about that help with this?

If I were to imagin-eer a solution, making all moves call a common event that flips the switch and then having a plugin that causes the damage popup itself to call another common event of my choosing (to flip the switch back) would make this a trivial solve, but I don't really know how/where to dig into the inner workings of the engine on that front.

An alternative, but less desirable solution would be a plugin that allows multiple animations to play at once independently of one another, but I didn't find anything like that (but I would be willing to settle for it).

I am using the Yanfly plugin library, for reference.
I am using the Yanfly plugin library, for reference.
Then programming your skills via Action Sequences can do what you want. You can turn switches on and off at any specific points during the skill's execution.
+1 to the action sequence recommendation. aside from it being easier to do for most...
from the start of any given attack animation until the end of that specific attack's damage popup
an attack doesnt necessarily have only one damage popup to be able to say "at the end of its popup". if you tried to flip a switch at the start of a skill and then flip it again once after doing damage, any aoe skill will do it after the first hit, and with yanfly's battle engine enabled, any skill that hits multiple times via action sequences or repeats will do the same

Original thread: https://forums.rpgmakerweb.com/threads/making-a-switch-that-is-off-from-start-of-attack-animation-to-end-of-damage-popup.171876/