Trying to get "If target has state, use this skill afterwards"

Hi, it's incredibly late and I should be asleep. Here's the skill I'm trying to create.

Actor uses Smokecut. It deals damage to a single target.
If the target does not have the state Smoke, nothing happens. The skill resolves as normal.
If the target *does* have the state Smoke, Actor then uses the skill Double Down on the target.

I would also love a method that lets me extend this to other additional effects--E.G., Actor uses Vaporize, and if the target has Smoke, Actor uses a simple AoE heal on the party.

I know little to no javascript; any I know I learned from shoveling around in RPG Maker MV in the first place. I'm stubborn enough to learn exactly as much as I need, though.

I have a lot of plugins I'm working with here (I'll run into a conflict sooner or later, lol), but of relevant note are Yanfly's Battle Core, Buffs & States Core, and Auto Passives. I'm eyeing Yanfly's Action Sequences and Victor Engine's FollowUp Skills as potential solutions.

*If at all possible*, I'd like to avoid doing this by putting code in the damage formula and by using invisible states, to avoid the possibility of jank, lag, and things generally blowing up and needing to re-do everything.
Actor uses Smokecut. It deals damage to a single target.
If the target does not have the state Smoke, nothing happens. The skill resolves as normal.
If the target *does* have the state Smoke, Actor then uses the skill Double Down on the target.
It seems like what you want is right in the Victor FollowUp Skills.

Code:
<custom followup skill: skill X>
result = target.isStateAffected(Y) ? Z : 0;
</custom followup skill>
X is the ID of Smokecut, Y is the ID of Smoke, Z is the ID of Double Down. No leading zeros.

*If at all possible*, I'd like to avoid doing this by putting code in the damage formula and by using invisible states, to avoid the possibility of jank, lag, and things generally blowing up and needing to re-do everything.
Nothing you describe there can cause lag. Some things shouldn't be in the damage formula, and this is absolutely one of them.
That particular string of code doesn't really seem to work. In fact, it crashes on boot. I'll attach the error message.

game_jHIEnXG8ii.png


I do have the VE Basic Module plugin installed, so I'm not missing a dependency. The code also seems correct to my untrained eye?
Please post the exact notetag that you have entered.
Code:
<custom followup skill: skill 17>
result = target.isStateAffected(4) ? 8 : 0;
</custom followup skill>

so the same thing, but with skill IDs swapped in
I dunno, then, looks like a bug with the plugin.

You could do a similar thing using Yanfly's Skill Core, put an After Eval that checks for the state and executes a forced action of the second skill.
I installed Skill Core and scrobbled around for the correct commands to make the user use a skill afterwards--I'm taking a break for now, but once I find how to check for a state the problem will be solved.
once I find how to check for a state the problem will be solved.
I already showed you that in my first solution, and you plugged the skill ID into it and everything.

To do it the Skill Core way, you'd do something like:
Code:
<Post-Damage Eval>
if (!target.isDead() && target.isStateAffected(4))
{
    user.forceAction(8, target.index());
    BattleManager.forceAction(user);
}
</Post-Damage Eval>

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-get-if-target-has-state-use-this-skill-afterwards.159005/