Conditional branch skill

As per the documentation, the <JS Pre-Damage as User> does not work as a skill note tag. You'd want to use <JS Pre-Damage> for skills.

In any case, let's check what we're doing here. Is my understanding correct that you want:

1. target acquires "I am Fire" state
2. target is attacked by Firecrit
3. target has a chance of dying

In that case, I think that either
a. the "I am Fire" state should have a <JS Pre-Damage as Target> note tag and not the "as user" variant
b. the "Firecrit" skill should have a <JS Pre-Damage> note tag

Also, and this may be because of the way the code is truncated in the screenshot, but I can't see the code that actually OHKO's the target. Could you double check if that is in place?
This is currently what I have for my state and skill, respectively.

(State)
<JS Pre-Damage as Target>

if (target.isStateAffected(141) && Math.randomInt(100) < 99) value = target.hp;

</JS Pre-Damage as Target>



(Skill)

<JS Pre-Damage>

if (target.isStateAffected(141) && Math.randomInt(100) < 100) value = target.hp;

</JS Pre-Damage>
I honestly don't know what to say except that it just works on my end (with just the <JS Pre-Damage> note tag btw, no need for the as target variant). Very simple test in which the first cast will apply the thunder state, and the second cast will OHKO the target as a result.

I honestly don't know what to say except that it just works on my end (with just the <JS Pre-Damage> note tag btw, no need for the as target variant). Very simple test in which the first cast will apply the thunder state, and the second cast will OHKO the target as a result.


I see what you've done, so it seems it WILL work. I was more posting my code to make sure I had it input properly, so you could see the code. I'll test this again tomorrow and let you know if it works.
I honestly don't know what to say except that it just works on my end (with just the <JS Pre-Damage> note tag btw, no need for the as target variant). Very simple test in which the first cast will apply the thunder state, and the second cast will OHKO the target as a result.


Yup, just tested it and it works. Thank you SO much for this.
Happy to hear it works!

Please use the report button to report the topic as solved!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/conditional-branch-skill.179866/