Force action on afflicted actor when state runs out.

Heyo.

I'm looking for a script that can causes a specified skill to be used upon an actor whenever a tagged state runs out.
The idea I have in my head is that the state would have a note tag along the lines of <removal_skill (x)>, where x is the ID of the skill that is used.

If that's not enough of a description, then I've created a small series of pictures to act as a visual example for how it'd look in-game.



Before we start, assume that the hypothetical RPG depicted has some basic core scripts installed, such as Yanfly's battle engine and such.

Scene: The protagonist, SHUMBURT, is thrust into the combat with the big bad evil guy, KILLBASTARD THE 2ST. His party accompanies him in the battle to avenge [insert family member here] and save [insert love interest here]

rpgh1.png




Turn 1, K.B. uses his skill, "Dim Mak" on Shumburt, dealing a minor amount of damage and inflicting the Pressure Point status effect on him.

rpgh2.png



Turn 2, K.B. does some move that is generally insignificant to the fight, like stalling or something, forfeiting the turn.

rpgh3.png



But uh oh! The Pressure Point state that was afflicted on Shumburt last turn runs out, causing him to be hit with the skill "Vein Explosion," which proceeds to do its animation, damage calculations, and status afflictions (in this case, Bleeding.)

rpgh4.png


The battle continues... Thankfully, the Cooler Shumburt will probably sacrifice himself to kill K.B. for good after he transforms into a horrible eldritch abomination for phase 2. Godspeed, Cooler Shumburt.



That's basically how I imagine it going in-game.

This is just one example of how it could be used. Another example would be a regeneration buff that culminates in a small full-party heal when it ends.
A much crueler example would be a debuff that, once it ends, instantly kills the victim.

I've tried looking to see if there's an existing script that does this, but either my Google-fu skills are truly weak, or it hasn't been made yet. Hoping the answer may lie here.
How about this script? Sounds like it could do the job.
How about this script? Sounds like it could do the job.
That's actually the script I tried before this, LOL.
Doesn't seem to be able to deal with skills, sadly.
I think you could go through a common event, in which you'd force the use of the skill. I use this script to change actor graphic to not moving when they are paralyzed etc. and back when the state is removed (I use Yami's battle system, which is side view, so you see your actors).

This is what I put in the note window of the state:

onremove: if self.is_a?(Game_Actor); $game_variables[107] = self.id;end

onremove: $game_temp.reserve_common_event(52)

Then in the common event, you can use the variable to say this actor should be forced to use this skill. I don't know how well you can use script calls for forcing action, if you need help, I could try :LZSgrin:
Doesn't seem to be able to deal with skills, sadly.
I had thought you were going to ask for help with Shaz's script.
We just need to figure out a way to get it to work with calling skills from the state note tag.
force_action would work but I don't know enough about it. Coincidently @EntangledPear is actually using common event commands to call force_action. so perhaps he/she/they can assist with the command.
If I'm not wrong, I think you can achiev this with Yanfly's lunatic state. But you should give it a try.

Original thread: https://forums.rpgmakerweb.com/threads/force-action-on-afflicted-actor-when-state-runs-out.156485/