Applying Buffs and Debuffs Globally in RPG Maker MZ

Hello everyone,

I'm working on a project in RPG Maker MZ and need help with applying buffs and debuffs in the damage calculation.

Problem:Currently, RPG Maker MZ applies buffs and debuffs to the base attack value before applying the damage formula. This makes buffs and debuffs unpredictable for the player, as the final damage result depends on the enemy's defense. I would like buffs and debuffs to be applied to the final damage result so that they are easier to understand and predict.

Example:For a basic attack, I use the formula: a.atk * 4 - b.def * 2.If a character applies a buff that increases damage by 200%, I want this buff to be applied to the final damage result. That is, if the attack did 100 damage, with the buff it should do 200 damage.


What I'm Looking For:I want a method (preferably a plugin) that ensures any buff or debuff applied through states, skills, equipment is applied to the final damage result.

Any help or suggestions would be greatly appreciated. Thanks in advance!
So...what is a "buff that increases damage"? There's no such thing in the editor.

You could have a buff that increases atk, or a buff that increases mat, but as you say that adjusts the parameter itself - there's no way to buff all damage.

Instead of using buffs, you should be applying a state and using a plugin that gives you ways to modify damage via notetags in the states.

You can use my Eval Tags, linked in my signature; or if you already have VisuStella plugins in your project, you can use their Battle Core.

With my Eval Tags, you'd give a state a notetag:
Code:
<Action Hit Eval>
if (skill.isDamage())
    value *= 2;
</Action Hit Eval>

That will cause all damage you do while you have that state to be doubled.
Thank you for the quick answer!

I tested it with your plugin and works like a charm!!!

I'm using the VisuStella Battle Core, so I was thinking... maybe it would be better to use the capabilities of that plugin to achieve the same effect and thus avoid adding another plugin to the list? Or does it not matter that much?

Honestly, I checked the help and information for the Battle Core plugin, but I didn't know how to search for what I'm trying to achieve...

Do you have any idea of what (keywords?) I should be looking for?

I'm not trying to be lazy or take advantage of your willingness to help, it's just that I'm genuinely a bit lost.

Anyway, if you don't have any ideas, the issue is already solved through your plugin, so I'm totally grateful to you =)
I'm using the VisuStella Battle Core, so I was thinking... maybe it would be better to use the capabilities of that plugin to achieve the same effect and thus avoid adding another plugin to the list? Or does it not matter that much?
That's why I said
if you already have VisuStella plugins in your project, you can use their Battle Core.

The code in my Eval Tags will cause conflicts with VisuStella plugins. They are not designed to be used at the same time.

Honestly, I checked the help and information for the Battle Core plugin, but I didn't know how to search for what I'm trying to achieve...
Do you have any idea of what (keywords?) I should be looking for?
Go to their Web-based documentation, and in the table of contents click on Mechanics-related notetags.

You'll find equivalents for what I gave you (it's probably, like, JS On Hit as User or something).

The code would be the same, except replace skill with this
I followed your advice and found the way to achieve the desired effect trough the battle Core.

It was:

<JS Pre-Damage as User>

if (this.isDamage())

value *= 2;

</JS Pre-Damage as User>

Thank you again, for real. This helps me so much with my project 😀

This thread can be closed now =)
Hello again... I think I celebrated victory too soon.

The notetag works, the damage is doubled, but I forgot that I want to differentiate buffs that enhance normal attack (`a.atk`) from those that enhance magic attack (`a.mat`), rather than always applying something general that includes both types of attack.

Is there a way to do this with this method? 😮
If you need to specifically look inside the damage formula, that's a little bit more complicated. But if you have your skills using the Hit Type to distinguish between Physical Attack and Magical Attack, you can change the conditional to be
Code:
if (this.isDamage() && this.isPhysical())
or
Code:
if (this.isDamage() && this.isMagical())
Unfortunately, it doesn't work... using either type of damage, the attack damage, whether magical or physical, is doubled without distinguishing. I tried changing the attack to `a.atk` and then to `a.mat`, but there is no difference.

The type of attack is "HP damage".

Any other ideas? :/

EDIT1:
It worked! I didn't understand the "hit type" part... I had it fixed on "physical," so it didn't take effect... 😛...

Now it does. I'm going to run a few tests to make sure it's working properly. I'll report back in a few minutes.

EDIT2: It's working consistenly =) Thanks again for your help!! I'm going to try this with defensive buffs too, I'll report if everything works. But I think I'm getting the "logic" in here... thanks.

EDIT3: I got it working for physical and magical defensive buffs =) =D

Original thread: https://forums.rpgmakerweb.com/threads/applying-buffs-and-debuffs-globally-in-rpg-maker-mz.170196/