ATB Interrupt Condition Javascript [Yanfly ATB]

Hey, looking for some help in regards to an ATB interrupt condition in Yanfly's ATB.

<ATB Interrupt Eval>

if () {

interrupt = true;

}

</ATB Interrupt Eval>


Here's the format I've been presented with, unfortunately, I have very little knowledge in regards to javascript and I was wondering if anyone could help me out. Here's what I need it to do:

I've changed the element types to a simplified 3: Shooting, Rush and Neutral. The idea is that certain skills can interrupt certain element types.

the logic I'd like to use:

If user is using a certain skill and target is using a "Rush element" type skill
Interrupt = true

Thanks to anyone who helps out in advance.
I don't have Yanfly's ATB to test this, but try this out...

Code:
<ATB Interrupt Eval>
var target_item = target.currentAction().item();
if(target_item && target_item.damage.elementId === x) interrupt = true;
</ATB Interrupt Eval>

where x is the element id for "rush element"

You may also need to change the first line to:

Code:
var target_item = (target.currentAction() ? target.currentAction().item() : false)

But I think a target that has atb charging always has a current action, so the first one "should" at least not crash your game! (no promises on it actually working)
I don't have Yanfly's ATB to test this, but try this out...

Code:
<ATB Interrupt Eval>
var target_item = target.currentAction().item();
if(target_item && target_item.damage.elementId === x) interrupt = true;
</ATB Interrupt Eval>

where x is the element id for "rush element"

You may also need to change the first line to:

Code:
var target_item = (target.currentAction() ? target.currentAction().item() : false)

But I think a target that has atb charging always has a current action, so the first one "should" at least not crash your game! (no promises on it actually working)

I deeply apologize for the late response, but, I'm very thankful for your help because it worked! The first one worked flawlessly and my game did in fact not crash. Thanks for the help.
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/atb-interrupt-condition-javascript-yanfly-atb.107105/