Making an Armor that gives a buff to a random stat at the start of each battle

This is a very simple question and I hope I don't sound stupid: How can I make an Armor that gives a 12% buff to a random stat at the start of each battle? The point of this is basically kind of like gambling; hoping you get the buff in a stat that you want to get buffed in that battle. It also makes all battles slightly different, one battle you might get a 12% Attack boost while the next battle could be the same buff or a 12% Max HP boost.

Alternatively, I could have this buff apply in the overworld instead and reset at the end (or the start?) of every battle, applying a different buff.
bump
easiest way imo would be using yanfly's passive states plugin and its requirements to make the armor give a passive with a battle effect (from the buffs and states core plugin - a prereq for the passives plugin) to buff a random parameter on the wearer. theyre part of the free plugin collection.

without plugins youd be able to use troop events to check if an actor has that gear equipped and use the script call to buff them or force them to use a buffing skill on them self at turn 0, but depending on your troop count that approach too may be better yet done with plugin assistance
easiest way imo would be using yanfly's passive states plugin and its requirements to make the armor give a passive with a battle effect (from the buffs and states core plugin - a prereq for the passives plugin) to buff a random parameter on the wearer. theyre part of the free plugin collection.

without plugins youd be able to use troop events to check if an actor has that gear equipped and use the script call to buff them or force them to use a buffing skill on them self at turn 0, but depending on your troop count that approach too may be better yet done with plugin assistance
im lost- how do i use these exactly? all i can understand is the notetags that apply a specific or multiple buffs rather than random buffs for the auto passive states plugin... i also checked the buffs and states core plugin but i dont see anything that can help here
the buffs and states core plugin provides a <custom battle effect> notetag to run effects at the start of a battle when a battler has that state. the passive effect plugin lets you bind states to equipment.

so if you wanted a armor that gave its wearer a random buff at the start of a fight, you'd start with a state that has a <Custom Battle Effect> notetag, use the script call to add a buff,
Code:
<Custom Battle Effect>
user.addBuff(Math.randomInt(8), 5);
</Custom Battle Effect>
and then use the passive states notetag to bind that state to some armor
Code:
<Passive State: x>
the buffs and states core plugin provides a <custom battle effect> notetag to run effects at the start of a battle when a battler has that state. the passive effect plugin lets you bind states to equipment.

so if you wanted a armor that gave its wearer a random buff at the start of a fight, you'd start with a state that has a <Custom Battle Effect> notetag, use the script call to add a buff,
Code:
<Custom Battle Effect>
user.addBuff(Math.randomInt(8), 5);
</Custom Battle Effect>
and then use the passive states notetag to bind that state to some armor
Code:
<Passive State: x>
this works...! but how do i make it apply the 12% boost rather than a flat number like 5 or 12?
i had assumed that you had already set your buffs to be 12% per stack somehow. by default, theyre 25%. the buffs and states plugin has a parameter that lets you change the value of each buff/debuff stack to whatever you want, but if you want this boost to be different from standard buffs then you want to use states instead of buffs
i had assumed that you had already set your buffs to be 12% per stack somehow. by default, theyre 25%. the buffs and states plugin has a parameter that lets you change the value of each buff/debuff stack to whatever you want, but if you want this boost to be different from standard buffs then you want to use states instead of buffs
im having trouble trying to do this so i might just do states, thanks!

Original thread: https://forums.rpgmakerweb.com/threads/making-an-armor-that-gives-a-buff-to-a-random-stat-at-the-start-of-each-battle.176541/