Making a move play music

I want to make a state that would tint the screen and play music until the state ends. I already made a skill for it and a common event that plays music and tints the screen, but I don't know how to end the common event when the state runs out. How would I do this?
the common event that starts everything should also control a switch that activates a second common event which is set to parallel process.
In that parallel process you'll check for the state and once it is gone you react to that, including disabling the second CE.

IMPORTANT: the parallel process should have a wait(10) to reduce lag.
This skill is meant to be used against enemy's in battle, I forgot to mention that..
I'm not sure how to check for the state with an enemy
The forget what I wrote before, parallel processes do not exist on battlescreen.

You'll need a troop event there, and might consider a base troop script to prevent having to add it to every troop.
The check for enemy state goes exactly the same way as the check for actor state: it's an option in conditional branch

A bigger problem is the timing with troop event conditions and troop event span. I would suggest using "Turn" but you might have to experiment there.

Original thread: https://forums.rpgmakerweb.com/threads/making-a-move-play-music.158794/