State applied rate = Reverse TP%

   Ok, I'm going to try and explain this as simply as possible. Basically what I'm trying to do is set up certain states to have a higher chance of being inflicted based upon how high/low the target's tp is. Basically I'd like for the state rate to go up as tp goes down, but only for certain states. Say, at 100 tp there would be a 0% chance of inflicting state A but when tp is only 20 there would be an 80% chance of it being applied. That would work and I think would be the simplest, if possible I'd also like to be able to set a minimum chance of some states that behave this way(because bleeding caused by a sword wound can't really be completely negated no matter how attentive you are to it)

   The reason for this is because I have modified tp in my game a lot already to work as a sort of stamina system for physical attacks in my game. Most physical attacks also have at least one state that they can add (ex. sword skills cause bleeding, blunt weapons damage armor and throw you off balance and staffs/polearms can be used to attempt and trip opponents, causing stun.) So any physical attack will cost stamina, at the same time however I want having low stamina a detriment by making you more vulnerable to the states that can be added through enemy physical attacks... sort of as a way to say that the tireder you are the more an attack will slip through your defenses.
You can use the damage formula bar for this...


try this equation


rand(100) < 100-a.tp ? b.add_state(id) : nil ; damageformula_here
   It would work but at the same time it would not. Most physical attacks already have three states that they remove from the attacker if present during execution which is necessary for another function in the game, and a lot (not all, but most) of my physical skills formula bars are already too full to add that into, + I would like to still have enemy state rates in play, and doing this through the formula bar means that the state chance would = "rand(100) - a.tp ?" regardless of this, correct?
you can make the add_states as methods inside game battler class and just call them from the formula bar

ex.

class Game_Battler def damagex(a, b.add_state(1) return DAMAGE_FORMULA_HERE endendthen on your formula bar, you would simply saydamagex( a, b )

you can also still try to use the target's resistances, just need to find out how it's computed...

Original thread: https://forums.rpgmakerweb.com/threads/state-applied-rate-reverse-tp.20750/