MV Make a skill be sealed if character doesn't have certain state

Hi, everyone. I need for my game that some skills cannot be selected during battle if the user isn't affected by certain state. Is this possible? If so, how can I do that? Thanks in advance.
Do your actors HAVE to have those skills if they don't have the state?

Adding the skills to the state rather than the class will allow the actors to have the skills only while they have that state.
@Shaz answer would be the only way i can think of for the base engine to do this.
but that method does have issues like 'ignoring level requirement to learn skill' and 'same state being the condition for other skills'

plugins can do this a different ways though like custom requirements from yanflys skill core
Do your actors HAVE to have those skills if they don't have the state?

Adding the skills to the state rather than the class will allow the actors to have the skills only while they have that state.
Yes, because I want the player to be able to see what skills they can use if they get other states (you can change states while in battle).
Moved to: Plugin Requests
It can be done using yanfly's skill core custom requirements:


<Custom Requirement>

</Custom Requirement>

Unfortunately I don't know how to achieve what I want using this. Anyone knows?

It can be done using yanfly's skill core custom requirements:

Unfortunately I don't know how to achieve what I want using this. Anyone knows?
It's bizarre, I feel like I just answered this exact question within the past few days.
Code:
<Custom Requirement>
value=user.isStateAffected(X);
</Custom Requirement>
where X is the ID of the state.
It's bizarre, I feel like I just answered this exact question within the past few days.
Code:
<Custom Requirement>
value=user.isStateAffected(X);
</Custom Requirement>
where X is the ID of the state.
Maybe you answered me but I wasn't able to understand. Sorry if that's the case.

Anyway, Thanks for your help! That code worked perfectly! I really appreciate the time you people take to answer these kind of questions. Hope you have a great day.

Original thread: https://forums.rpgmakerweb.com/threads/make-a-skill-be-sealed-if-character-doesnt-have-certain-state.140058/