Title pretty well explains the idea.
Examples: Skill Execute only works during ability Enrage.
Weather manipulation class turns the weather into Rain, causing all battlers to gain the "Rain" state. while under the rain state, you can now use more powerful water spells you couldn't use without the Rain effect.
You're a bad player trying to get through the game, but you're only allowed to revive someone once per battle, as doing so grants them a state causing them to become immune to being revived.
Yanfly has several plugins that do this already. Skill core, auto passive states and skill cooldown will do all of this. You will need to know some js for some of it.
hmm....... any idea of any way it could be done, or how the js coding would look for it?
Could you be a bit more specific? What have you tried that didn't work? How did it not work? Were there specific error messages, or did 'nothing' happen? Did any of the plugins do anything? etc. etc. It's very difficult to answer such a vague question.
I haven't tried anything, I don't know any of the js required for it. Essentially I need a means of tagging an item to be "unusable" if state X exists on the target. Idk if you can write out "if" statements in a note tag, but for example, something like "if state 20 exist, "they can't use that item now", else use item"
Being revived inflicts a state on that actor. That state never expires. It will get more complicated if you do not use a Passive State plugin, though it can be done. You would have to create the state without checking the box "Remove at the end of battle". Inns remove states, so all your inn events would have to check for the existence of the state before the Recover All command, and re-inflict it afterwards. With a plugin, you would simply assign the passive state (usually just with a note tag) and that would be it. The plugin would tell you what the note tag to use is.
Anyway, on to implementation. The only way I can think of is by using the damage formula to check if the target is state inflicted. If yes, it does nothing, if no, it revives. Your item description would have to include the fact that "If the actor has been revived before, this item is wasted." The formula would look like this:
b.isStateAffected(ID of the state) ? 0 : b.removeState(1); b.mhp\5
That revives with 20% of MHP. Change the mhp\5 to whatever you want the HP to be after revive
In the 'Effects' box of the item you would add the identifying state, so that if this time it revives, next time it will know to do nothing.
Note - I use Ace which is Ruby, so I hope I've got the JS version correct. The thing I'm unsure about is the use of the semi-colon in the second part. Ruby needs it, JS might not. Try it as written, and if it doesn't work, try removing that semi-colon.