Creating a state that increases certain stats after receiving physical/magical attacks.

Is that possible to create a state that increases certain stats after receiving physical/magical attacks. The effect can stack, and it can be capped at certain range (for example : 50%).

For example :

1) Avenger : Increases ATK by 10% after receiving physical attacks. Maximum : 100% 

2) Lust : Increases MAT by 10% after receiving magical attacks. Maximum : 100%

If someone can make events or scripts for this. I would appreciate.

.
It can only be done with scripts, but please state for which program you want a script: Your profile says you're using VX Ace, but you posted in the forum for VX - those are two different programs, requiring different scripts.
My bad... Please move it to VXACE section.

Bump.
Though it would be completely possible to achieve that without scripts, it is not a built in functionality. Using scripts (especially for the stacking part) would definitely be more convenient.

If I remember correctly Neon Black wrote a script for stacking states. I don't have a link right now, but you shouldn't have much trouble to find it.

If you want all skills/items to apply a certain state when certain conditions are met, you could use this script so you don't have to add the states to every single skill in the database:

Spoiler
class Game_Battler   alias_method🙂item_apply_ILC_addCustomStates, :item_apply)  def item_apply(user, item)    item_apply_ILC_addCustomStates(user, item)  # <- execute the earlier defined part of this method    if @result.hit?  # <- only add other stuff if the action was a success      # -----------------------------------------------------       add_state(10)  if item.physical? and state?(11)      add_state(12)  if item.magical? and state?(13)       # -----------------------------------------------------    end  endendThis script will execute custom stuff whenever a battler is hit by an action.

In this example, the target will be inflicted with state 10 when the action has physical hit type and the target is already inflicted with state 11. If the action is magical, state 12 is inflicted if the target is already inflicted with state 13.

You can replace the numbers or add other code at will.
It works perfectly with Neon Black's stacking states. Many thanks!

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-state-that-increases-certain-stats-after-receiving-physical-magical-attacks.38355/