You can set a state to add or seal skill types in the database.
You can do the same for single skills, as well.
Go to the states in your database, on the right are effects of the state. Add new, choose tab "skill", you can choose to add the skill there.
I think you will need an edit to the script then, because as far as I can tell, if you haven't learned the skill, the learn conditions script will never let you use that skill, regardless of what you put there for the skill conditions script. The only other way is to make a second copy of the skill which you can cast when the state is applied (by setting it under the state that the state gives that skill).
Though you will then have the issue that both copies of the skill will show up if the actor has learned it and is inflicted with the state.
My suggestion would be to come up with a unique version of a skill that is only castable when under the state. That way it works within the system. Otherwise, you will need an edit to the script, which you may need to request.
Yes, there is a string, which is for paying the cost to use the skill, once you already learned it. It does not handle giving you the skill in any way, shape, or form. They are two separate things.
See, the reason you are having a problem is it will be looking for you to 'pay' a state, which makes no sense. Costs can only be HP, MP, TP, or items, weapons or armor, and they are consumed. The system cannot consume a state, so that is why it doesn't work.
No, it doesn't. You want the skill to be useable when you have a state but you haven't learned it, right? That is what I'm saying you can't do. You see, for the skill cost manager to work, you *have* to have already learned it. Period. It is not set up to work any other way.
So, let's check this again:
Way I read it, you want the skill to be learnable, plus also useable when under a state? Or do you want it learnable AND only useable when under a state? Which one determines how you have to do it.
You could try when any battle ends, seal that skill?
Ok, I was reading it as you wanted to be able to use it if you *had not* learned it, which is why I was saying it was impossible. For what you stated, it can be done. Here is how you do it.
The script call to see if someone has a state is this:
state?(x),
where x is the state id of the state you wish to check.
So to check for the default poison, do this:
<custom cost requirement>
state?(2)
</custom cost requirement>
Change 2 to what your poison State ID is.
I tested it in a blank project with all Yanfly's scripts installed, and it worked. The skill was not selectable when not under the state, and selectable when under the state.