MV [Yanfly] issue with custom passive state condition

Hello!
I have an ability system in my game where most armor pieces grant a passive ability, and a set of these passive abilities are stat-boosting passive states that only work if a specific actor (in this case named "Erika") has that piece of armor equipped and nobody else. to achieve this I put the following note tag in her note box

Code:
<Passive State: 40 to 59>
(these are all of the states but this issue will only address the one actually implemented)

and to make it so this passive state activates when wearing the armor I wanted, I put the following note tag/code into the note box of the passive state

Code:
<Custom Passive Condition>
  if $gameActors.actor(2).hasArmor($dataArmors[410]) {
    condition = true;
  } else {
    condition = false;
  }
</Custom Passive Condition>

However, after putting this code in the game proceeds to crash upon the game's launch, not even making it to the title screen

Spoiler: crash image
1687666101638.png

This only stops happening once I remove the custom passive condition code. So, to put it simply, what exactly did I do wrong here? And how can I fix it?
Well I've looked it over and I'm pretty sure it's something to do with the formation of something in
if $gameActors.actor(2).hasArmor($dataArmors[410]

I guess one question I have is, do you have 410 pieces of armor?

Incidentally, wouldn't it be more logical and less typing to have the armors apply the state, and test to see if the wearer is so-and-so?
Well I've looked it over and I'm pretty sure it's something to do with the formation of something in


I guess one question I have is, do you have 410 pieces of armor?

Incidentally, wouldn't it be more logical and less typing to have the armors apply the state, and test to see if the wearer is so-and-so?

I don't have exactly 410 pieces of armor, however, I sort my armor in the database in order to make finding each individual piece of armor easier. 410 just happens to be the ID of the armor I was working with here.

As for your suggestion, that was my first idea, but I wrote it off because I didn't know if it would even work logistically since the only thing I can think of is having the state see if it's applied to the correct actor, but that would require checking if itself is applied or not, which I assume wouldn't work because it would not apply unless the condition was already met unless I'm seriously misunderstanding how yanfly's passive state conditions work.

that being said I'll try giving it a shot anyway if I don't see any other suggestions once I wake up tomorrow morning.
Okay, I've become obsessed with this. Why doesn't this work? Is actor being called correctly?
<Custom Passive Condition>
if $gameActors.actor(2).hasArmor($dataArmors[410]) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>

I figured it out for you, you are missing the brackets it is meant to be. I tested it and it works.

if ($gameActors.actor(2).hasArmor($dataArmors[410])) {
I figured it out for you, you are missing the brackets it is meant to be. I tested it and it works.

if ($gameActors.actor(2).hasArmor($dataArmors[410])) {
Should've known it'd be something small like that,
regardless, it works. Thanks to both of you for trying to help me with this, it saved me a headache.
This thread is being closed due to being solved. If you would like it reopened, report it to let us know why. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-issue-with-custom-passive-state-condition.158663/