Dynamic Buff

Dynamic Buff
Author: Vyndicate


There's a part that you want to give a buff to allies or enemy gain a buff
But you also want to make it dynamic instead of 25% of each buff (or other value from plugins)

You can make it dynamic with this plugin

Description:
This plugin to make buff increase dynamically
Create a dynamic buff based on state you use

Notetag (States):
<BUFFS: [
{"paramId": 0, "buff": 2, "based": true, "type": 0},
{"paramId": 1, "buff": 1.3}
]>

paramId (Mandatory) => parameter id (Refer to game data)
buff (Optional) => Multiplier or Flat, depends on type, default will
multiplied by 1 or added by 0. Can use negative value
based (Optional) => Whether you want multiply from base only or with other calc
type (Optional) => between 0 and 1 (Only when based = false)
if 0, The buff will do multiplication
if 1, The buff will do addition

Default value:
based = false
type = 0

In that example, paramId 0 and 1 is Max HP and Max MP

Example of using based = true:
Def from stats = 10, def from other source (Armor, weapon, etc) = 20
Total def = 30
Buff = 2x
Total def after buff = 10 * 2 + 20 = 40
if based false, it will like this => (10 + 20) * 2 = 60

You can write either in one line or like example above

You can also write string like:
<BUFFS: [
{"paramId": 0, "buff": "v[3] + value / 200 + this.paramOrigin(4) / 5"},
{"paramId": 1, "buff": 1.3}
]>
v => variable value
value => param value of that id (in this case is mhp)
this.paramOrigin(x) => parameter value, same as param but in other function
to avoid recursive loop

You can use other like this.paramBase, this.paramPlus, etc. But avoid
this.param(), use this.paramOrigin() instead

Notetag (Weapon, Armor):
<BUFFS: [
{"paramId": 2, "buff": 0.5, "type": 0, "armorId": 2, "armorSlot": 2},
{"paramId": 2, "buff": -0.5, "type": 0, "armorId": 2, "armorSlot": 3}
]>

Pretty much similar to states but without based, with addition armorId,
armorSlot, weaponId, and weaponSlot

Buff value 0 is neutral, buff value 1 will double the value (Ex: atk +15,
buff: 1 will become atk +30). Remove the upgrade, set to -1. Assuming all
of this using type: 0

armorId can exist alone, but armorSlot need armorId. Similar to weapon

So far, the usage between armor and weapon separated. So it will like this
<BUFFS: [
{"paramId": 2, "buff": 0.5, "type": 0, "armorId": 2, "armorSlot": 2},
{"paramId": 2, "buff": -0.5, "type": 0, "weaponId": 2, "weaponSlot": 3}
]>

I'm yet to create if armor and weapon must exist, buff applied

Regarding how big the value is, you can go crazy whatever you want

From changelog 1.3.3: Thank you for someone mentioned me in Discord regarding this bug

Terms of Use:
Free for commercial and non commercial use with credits

Changelog:
v1.3.3
Simplified code
Fix multiple state use the latest one

v1.3.1
Fix when get .equips() cause error for enemies

v1.3.0
Add notetag for weapon and armor

v1.2.0
Add type, change buff between flat add or multiply it, and this.paramOrigin() function

v1.1.0
Add custom value, multiplier based on what you need, with variable and value

v1.0.0
Init plugin

Showcase:


Screenshot 2025-04-07 184600.png


In this case, allies who get Emergency Defense gets Max HP buff by 2x, def by 10x, and magical def by 10x

Stats before getting buff:
Screenshot 2025-04-07 190325.png


Stats when getting buff:
Screenshot 2025-04-07 190338.png


Showcase regarding weapon and armor notetag:


Notetag used for this showcase:
Code:
<BUFFS: [
{"paramId": 2, "buff": 0.5, "type": 0, "armorId": 2, "armorSlot": 2},
{"paramId": 2, "buff": -0.5, "type": 0, "armorId": 2, "armorSlot": 3}
]>
this looks useful 🙂

specially for states, maybe you can do similar to armor/weapons too?
this looks useful 🙂

specially for states, maybe you can do similar to armor/weapons too?
Is it like when wear this item, increase stat by value?

I just want to make sure before doing stuff
yes.

like weapon has 10 attack, but can get +5 if armor X is on or armor X in slot
4 (accessory) if armor X is in 5, than -5 attack.

so if it can check equips based on slots position, you can make it really dynamic
or add stats this way as well to boost stuff.

but if you have passive stats from an accessory, you can boost the weapon too
or armor 🙂

if that makes sense?
yes.

like weapon has 10 attack, but can get +5 if armor X is on or armor X in slot
4 (accessory) if armor X is in 5, than -5 attack.

so if it can check equips based on slots position, you can make it really dynamic
or add stats this way as well to boost stuff.

but if you have passive stats from an accessory, you can boost the weapon too
or armor 🙂

if that makes sense?
Interesting take, I'll consider this then

It might take a while
Update:
v1.3.0
Add notetag for weapon and armor

Stats value will be changed regarding weapon and armor notetag. But so far, it doesn't buff automatically (Ex: Put specific armor it will not buff all available params in database, but buff from the paramId that has been set in notetag), you need to set with correct paramId manually to buff it (Assume using type: 0)
nice, this is really awesome, thank you =)
Update:
v1.3.1

There's a bug when encounter battle, Game_Enemy.prototype.equips() cause an error
Update:
v1.3.3

When using multiple of states, it will cause a bug that you only using latest state applied
Also simplified the code

Thanks to someone that mentioned me in Discord about this bug

Original thread: https://forums.rpgmakerweb.com/threads/dynamic-buff.176805/