Yanfly Skill Core custom requirements

Yo! I have a sweet spell in my project which can only be used if caster is under specific state. There is the note:

<Custom Requirement>

if (a.isStateAffected(25)) {

value = true;

} else {

value = false;

}

</Custom Requirement>

Question is: Is it possible to make this skill require state from above (25) OR another specific state (for example: state 26)?
Like, you know "you can use this spell only if you have at least one of following states: 25, 26"

I hope that I explained it clearly enough. Thanks for your time!

Kisses
xoxo
Try:
if (a.isStateAffected(25) || (a.isStateAffected(26)) {

value = true;

} else {

value = false;

}

</Custom Requirement>

|| is the logical operator for "or"
It is not working that way. When I wrote it this way (got <Custom Requirement> at the beginning ) It stopped working even for state 25 and spell could be used any time.
Sorry, how about like this,

<Custom Requirement>

if (a.isStateAffected(25)) || (a.isStateAffected(26)) {

value = true;

} else {

value = false;

}

</Custom Requirement>
Tried the double )) thing already. It ain't work either.
Okay, one more attempt on my part...
<Custom Requirement>

if ((a.isStateAffected(25)) || ((a.isStateAffected(26))) {

value = true;

} else {

value = false;

}

</Custom Requirement>
No positive results sadly. I think that I should just do it in other way.
Still, thanks for help sugar.
@Eliaquim would you know how to solve this?
@Eliaquim would you know how to solve this?
I never used the yanfly plugin, and my knowledge in the battle scene is not that great.
So assuming you are using the correct functions, I think the javascript approach to the question:
Question is: Is it possible to make this skill require state from above (25) OR another specific state (for example state 26)?
Like, you know "you can use this spell only if you have at least one of the following states: 25, 26"

it is this:

JavaScript:
let allowedStates = [25, 26, 27];
let value;

allowedStates.forEach(function(stateId) {
    if(a.isStateAffected(stateId)){
        value = true
    }else{
        value = false
    }
});
Not working sadly.
I don't think my code is right too.
But I don't know how yanfly and battle system works to check states. I will see if I can do it later
@xDragoonx In your attempts it seems always one closing bracket is missing or the brackets are just wrongly placed, but you actually don't need so many brackets. The probably correct version would be:

Code:
<Custom Requirement>
if( a.isStateAffected(25) || a.isStateAffected(26) )
{
    value = true;
}
else
{
    value = false;
}
</Custom Requirement>


@Eliaquim Your loop changes the value back to false, if the last of the allowed states (in your case 27) is not affected:
Code:
<Custom Requirement>
let allowedStates = [25, 26, 27];
value = false; // I don't think value must be declare using let, it's already declare by Yanfly in calling function.

allowedStates.forEach(function(stateId) {
    if(a.isStateAffected(stateId)){
        value = true;
    }
});
</Custom Requirement>

But the actual shortest version would be:
Code:
<Custom Requirement>
value = a.isStateAffected(25) || a.isStateAffected(26);
</Custom Requirement>

@oliwermon I hope these 3 versions will all work. I actually haven't tested it.
@BurningOrca I figured I was just messing up something simple like that...I'm still learning javascript so I really appreciate your help in correcting my mistake! Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-skill-core-custom-requirements.120892/