MV Trying to use Yanfly's ActSeq for "has Skill" skill conditions

I'm trying to make it so that a skill gives the user more TP if the actor using it has a specific skill.

<setup action>
if BattleManager.actor().hasSkill(14)
TP +5: user
end
</setup action>

This always gives the user +5 TP, no matter if the user has skill 14 or not. "isLearnedSkill" behaves the same.

<setup action>
if BattleManager.actor().isStateAffected(15)
TP +5: user
end
</setup action>

This seems to work perfectly, but I'd like to have it work on having a skill, not a state. What am I doing wrong?
You can just use "user" instead of this long "BattleManager.actor()" phrase. Just try it to see if it makes any differences.
There's no reason to go through the BattleManager, action sequences provide the "user" variable for you.

Also, any time you post code, you should use the CODE tags (the </> on the edit bar). It preserves indentations and the contents of brackets.

But your code basically looks good to me. I would change it to if user.isLearnedSkill(14) just to go through fewer hoops, but if that doesn't work...maybe double check that they really don't have that skill? Use the console (F8) and type in
Code:
$gameActors.actor(x).isLearnedSkill(14)
where x is the ID of the actor you're checking, and see what it returns.
Thanks for the insanely fast replies. I switched the long phrase to "user" and changed the function to "isLearnedSkill", so now the code looks like this:

Code:
<setup action>
if user.isLearnedSkill(14)
  TP +5: user
end
</setup action>

However, it still behaves the same. My actor 1 caps at lv 1 and its class only learns skill IDs 3 to 5, and my actor 2's class teaches it the skill ID 14 at lv 1. Actor 1 also gains the bonus 5 TP even though it does not learn skill ID 14.
I opened the console as suggested and wrote the line and it returned true for some reason.

EDIT: I didn't know about the console check, that was very useful. It allowed me to confirm there was nothing wrong with the code, and apparently YEP_ClassChangeCore makes it so that every skill is always treated as learned, even if I change the loading order. After disabling it, the skill works as intended.
apparently YEP_ClassChangeCore makes it so that every skill is always treated as learned, even if I change the loading order. After disabling it, the skill works as intended.
That isn't right. There's nothing in the Class Change Core that should do it, and it doesn't do it for me (I just checked and immediately got "false" for checking a random skill).

Check that your plugin order matches the order listed on the Yanfly Engine Plugins site, check that you're using the newest versions of them.
I changed the plugin order to match what's in the website, nothing changed. Every plugin is updated too. I tried using the console command again and it returned true for every actor in the battle.
Well, you can type into the console
Code:
$gameActors.actor(1)._skills
and it will list the skill IDs that actor 1 knows. You can't get any more fundamental than that - if the ID is on that list, you're doing something to cause them to learn it and not realizing.

If the ID isn't on that list but you're getting a result of true from the hasSkill()...try it in a new project, with only the Class Change and any prereqs. If you confirm that works as expected, try disabling half of your other plugins at a time, see if it's actually another plugin in conjunction with the Class Change that's doing it.

Like I said, I can't duplicate the bug, so it's not an inherent problem with the plugin - it has to be something with your project.

Either you've accidentally done something where they do in fact have the skills, or another plugin is also messing with the same functions and causing that unexpected result.
I used the console command as suggested and it showed me that actor 1 had every other class' skill learnt (my game only has classes 1 to 4 right now).

I checked Class Core's plugin settings and it has classes 1 to 4 unlocked by default (?), and apparently it treats every unlocked class' skills as a learnt skill, so my class 1 lv 1 actor also had the lv 1 skills of the other classes. I erased the default unlocked classes and it works fine now, +5 TP to skill havers and nothing for the rest.

I don't plan to use this plugin anymore though (I learned how to script call what I wanted from it), so my issue is solved.
I checked Class Core's plugin settings and it has classes 1 to 4 unlocked by default (?), and apparently it treats every unlocked class' skills as a learnt skill, so my class 1 lv 1 actor also had the lv 1 skills of the other classes.
Well, yes. If you have a class unlocked, that means you know whatever skills of your level in that class. I didn't see what you were getting because I don't have class-unique skills at level 1.

The game determines whether you can use them by whether you have access to the appropriate skill type via your traits, but you know everything of every level of every class you can access.

You could work around this by calling canUse() instead of hasSkill(), but you said you're not using class changing anymore so that might be a moot point.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-use-yanflys-actseq-for-has-skill-skill-conditions.152621/