Adding Passive Skills to Yanfly's Passive States

Yanfly's Passive States script lets the user add a <passive state x> note on actors, classes, equipment, and enemies. While I may use some of these is the future, I'm trying to modify the script to also search for the tag in skills the actor has. I know there are already scripts that do this but while the mild programming background I have helps me get the general idea of what a script is doing, I'm trying to modify this to gain an understanding. Here's Yanfly's script : link

I can see on line 116 that it is searching for the tag in the various categories so I added the the data for the skills like so:

groups = [$data_actors, $data_classes, $data_weapons, $data_armors, $data_enemies, $data_skills] After I tried this and it didn't work I checked again, and it looks like later in the script it checks everything again when it actually applies the state. So I tried to copy it down by line 198, adding a for statement for self.skills.passive_states making mine looks like this:

for state_id in self.actor.passive_states array.push($data_states[state_id]) if passive_state_addable?(state_id) end for state_id in self.class.passive_states array.push($data_states[state_id]) if passive_state_addable?(state_id) end for state_id in self.skills.passive_states array.push($data_states[state_id]) if passive_state_addable?(state_id) end for equip in equips next if equip.nil? for state_id in equip.passive_states array.push($data_states[state_id]) if passive_state_addable?(state_id) end endThis however results in a "SystemStackError occurred. stack level too deep"

Anyone who knows more than I see my error? Sorry if this is long winded, first post.
It's one of those tricky things where using self. instead of @ just doesn't work.  Try replacing your skill for loop with the following.

for skill in @skills for state_id in $data_skills[skill].passive_states array.push($data_states[state_id]) if passive_state_addable?(state_id) endendNote if you just replaced self. with @ you would have run into another error, since the skills array is actually just a list of numbers, I fixed that part as well in the above.Edit: There might be a way to do it with self.skills, since @skills does have some limits. I'd look through Neon Black's Passive Skills script, I believe the @passover variable was used to get around the infinite loop that causes the stack too deep error.

http://forums.rpgmakerweb.com/index.php?/topic/4693-passive-skills/
Alright, I got it working using @skills. Would the limitation your referring to be the issue I read about where if you make a bunch of skills, then delete some your highest skill id will be higher than the number of skills? I'll try to see if I can't get the @passover method to work instead. The script is short enough it shouldn't be to hard to understand.

Also for anyone else reading, to get the above to work replace the two "skill" mentions with "skills"
You're probably going to wind up using Yanfly's passive skills instead.
As far as I can tell, Yanfly doesn't have passive skills, which is what I'm trying to add to it. Later, when I get a chance, if I can get something similar to Neon Black's @passover method to work inside Yanfly's script I'll have a script fully compatible with YEA, and hopefully a better understanding of the scripting.

Original thread: https://forums.rpgmakerweb.com/threads/adding-passive-skills-to-yanflys-passive-states.23930/