MV Quick question about Yanfly's Auto Passive States

I know you can set up a custom passive condition with the plugin, but can you make a condition that requires the actor to have a specific skill learned?

I imagine you probably can, but I'm not sure how to write it. The plugin in question is linked to below.

How do you mean? Do you require the actor to have a specific skill in order to have the state applied? Get the state but require a skill in order to apply its effects? Always have the state once you've learned a skill?

The answer is yes, but how you'll do it depends on what you mean.
I know you can set up a custom passive condition with the plugin, but can you make a condition that requires the actor to have a specific skill learned?

I imagine you probably can, but I'm not sure how to write it. The plugin in question is linked to below.

Try:
Code:
<Custom Passive Condition>
user.isSkillLearned(X)
</Custom Passive Condition>
Replace X with the Id of the skill you wish to check.
Also make sure to add this state to the actor's note box.
How do you mean? Do you require the actor to have a specific skill in order to have the state applied? Get the state but require a skill in order to apply its effects? Always have the state once you've learned a skill?

The answer is yes, but how you'll do it depends on what you mean.
The third option is what I'm looking for. I want to give every actor a state, but in order for the state to apply, they need to know a particular skill.

@xDRAGOONx
Didn't work, unfortunately. Actor has the state, and that code is in the state's notebox, but it still takes effect without having the skill.
Try this instead.
Code:
<custom passive condition>
if (user.isLearnedSkill(x)){
condition = true
} else {
condition = false
}
</custom passive condition>
@xDRAGOONx - per the Lunatic Mode documentation, a straight boolean won't work. Yanfly has a little internal variable called called "condition" that needs to be used, or the custom condition won't do anything. That allows for more complex rules than you could get with a one-operation conditional.
@xDRAGOONx - per the Lunatic Mode documentation, a straight boolean won't work. Yanfly has a little internal variable called called "condition" that needs to be used, or the custom condition won't do anything. That allows for more complex rules than you could get with a one-operation conditional.
Yes, thank you for correcting me. I even copied the notetag setup from one of my existing states and still missed this...so thank you again. Also, @ramza thank you for providing the correct code, and for your amazing plugins!
Np. The function being named backwards has caught me a couple of times when I'm not paying attention. I don't know why isLearnedSkill is used instead of isSkillLearned :/
@ramza So, your solution works. . .as long as I actually learn the skill, and not just gaining it via "Add Skill". Jeez, why is that trait so finicky?
@ramza So, your solution works. . .as long as I actually learn the skill, and not just gaining it via "Add Skill". Jeez, why is that trait so finicky?
In that case, you can use user.skills().includes($dataSkills[x]), which combines all skills learned with all skills gained via traits. Replace x with the id of the skill, of course.

Original thread: https://forums.rpgmakerweb.com/threads/quick-question-about-yanflys-auto-passive-states.133864/