YEP_BuffStates Core Question

I would like to know how to make simple attack buffs and defense debuffs. In my mind, these buffs/debuffs would increase or decrease the stat variable ( Stat Variable = the attack or defense stat from the targeted actor ) by 15%. I have not worked with code in the past, so I looked on forums and tried to stitch together something that made sense, at least in my mind.

Code:
<Custom Apply Effect>
If (target.isactor()) { target.atk * 20 }
</Custom Apply Effect>

<Custom atk Buff Turn>
turn = 10
turn += user.agi;
</Custom atk Buff Turn>

If someone could lay out the building blocks, I can replicate it for each buff / debuff.
The engine has a basic stacking buff/debuff system for basic params (MHP, MMP, ATK, DEF, etc). You can apply +1 (de)buff via the Effects list of a skill or item. By default each (de)buff level corresponds to ±25% to that parameter, and can stack up to a total of ±50%. Debuffing a buffed param removes one buff level, etc. 👋

If you don't need it to stack, you can simply use a state with a Parameter Rate: Attack trait. 115% is an increase of 15%; 85% is a decrease of 15%. These traits combine multiplicatively. 😮‍💨

Otherwise I think you will need a plugin, e.g.
  1. Something that can change the default buff system, e.g. the plugin parameters (editable via the Plugin Manager) of Yanfly's Buffs & States Core; or

  2. Something that can implement stacking states (I don't know of one, maybe someone else does); or

  3. Something that can set custom parameter formulae, e.g. the plugin parameters of Yanfly's Base Parameter Control (paid plugin).

Your attempt with a <Custom Apply Effect> tag from Buffs & States Core is flawed for several reasons:
  • Invalid code: if (target.isActor()) target.atk *= 1.15; could be valid, but...

  • Parameter values like atk cannot be changed like that. Their value is determined based on the actor's class/level, current equipment, permanent bonuses (e.g. from the Change Parameter event command), and traits.

  • If you work around those two points, you would (I assume) also need some way to undo the ATK change once the state wears off. In theory you could remember the offset before applying it, then remove that offset when the state ends. However, I seem to remember Yanfly's Buffs & States tags only running during battle, which if true would make this approach somewhat bug-prone. 😴
Thank you for the help, it means a lot to me that you would take the time to answer a question this simple with a paragraph of useful information

Original thread: https://forums.rpgmakerweb.com/threads/yep_buffstates-core-question.131971/