Need help on casting a skill, activate a switch then after the animation ends, turn off the switch

So I have this battle system that needs this to be activated.

For example:

I want Switch #1 to activate when a certain skill has been selected, after the animation ends, I want the switch to be turned off after the animation.

Using the "Wait" command then turn off switch isn't my type since I use timed attacks.

If anyone does know, please do share, thank you!
With yanfly action sequences you could do this. Turn it on during setup phase then turn it off during end phase
that completely depends on what your battlesystem is - by default it can't be done, it requires a battlesystem that supports different parts in a skill sequence.

so describe and link to the battlesystem scripts/plugins you're using, and maybe we can tell you what to do.
I tried HumanNinjaToo's solution but it doesn't work for me.

What I just did is just create a common event and a copy of the skill.

EX:

Fire (The Activation Skill) [F#1]
Fire (The Animated Skill with Damage) [F#2]

So I put the common event in the F#2. The common event is as follows:

Turn Switch #1 ON
Force Action F#2 Last Target
Turn Switch #1 OFF

I know that this is gonna be messy in the long run but this is the best solution I could find. Thank you very much for the help everyone!

Original thread: https://forums.rpgmakerweb.com/threads/need-help-on-casting-a-skill-activate-a-switch-then-after-the-animation-ends-turn-off-the-switch.125740/