MV Help configuring YEP_DamageCore Damage-Steps

YEP_DamageCore enables you to take control over how damage in battles is calculated, so I wanted to use this to straighten out my balancing a bit by making enemies hit a little harder, but receiving less healing.

However I am not quite sure where to put it.
In the beginning, I just put these at the very end of the damage calculation:

#1 Enemy damage amplified
JavaScript:
if (target.isActor() && value > 0 && !critical) {
value = Math.max(value * 1.30, value + 10, value ** 1.04)
}

#2 Enemy Healing reduced
JavaScript:
if (target.isEnemy() value < 0 && !this.isMpEffect) {
value = Math.min(value * 0.6, value + 10)
}

Putting these at the end not only does not work properly,
but also seems to neglect any elemental resistances.

Now here are my questions:
1. Where and how would I integrate these formulas? I don't really care how it gets done in the end, as long as the functionality is there.

2. Concerning #1, how do I make it so that the bonus damage only applies when enemies do the damage?
-> I have some self-damaging abilities

2. Concerning #2, how do I make it so that the reduced healing only applies when enemies do the healing?
-> There are some ways that the player can heal enemies

3. How can I avoid "neglecting elemental resistances"? Basically what happened is that I hit any enemy with an attack they should be weak to, but it dealt "neutral" damage instead.

4. Maybe the conditions can be tidied up a bit?
Basically, all direct damage from Enemy -> Player should be amplified only after all the calculations are done
(That's why I put it at the end)
And all direct HP healing from Enemy -> Enemy should be reduced

DamageCore.png
  1. I think you omitted an && in the condition in your second block of code. That will likely cause the entire custom damage sequence to fail to apply, hence the way in which it's ignoring elemental rates (untested). If you check the console (F8 during test) you may see an error message of some kind. Try this instead:
    JavaScript:
    if (target.isEnemy() && value < 0 && !this.isMpEffect()) {
      value = Math.min(value * 0.6, value + 10)
    }


  2. Enemy -> actor damage amplification:
    JavaScript:
    if (user.isEnemy() && target.isActor() && value > 0 && !critical) {
      value = Math.max(value * 1.30, value + 10, value ** 1.04)
    }
    Enemy -> enemy healing reduction (including correction from point 1):
    JavaScript:
    if (user.isEnemy() && target.isEnemy() && value < 0 && !this.isMpEffect()) {
      value = Math.min(value * 0.6, value + 10)
    }


  3. See point 1.

  4. It looks pretty tidy to me, try out the above adjustments and see how it goes~ 🙏
[Edit: corrected isMpEffect reference (see follow-up post for details).]
@caethyril
It was that easy, huh?
Well it seems that I flunked the code again,
that's what I get for copy & pasting code so recklessly without checking it again 😮‍💨

I was actually aware of user.isEnemy(), and I even tried that, but since I omitted the && it was not going to work either way.

So I thought the plugin needed some other expression for user (some plugins use origin. I believe)

Anyways, I did some testing and everything seems to work as intended now.
Thank you again for your time. 😂
(For Yanfly's plugins, origin is a separate thing: it's used by Buffs & States Core to reference the one who applied a state. 🙂)

It was an easy mistake to make, no worries! Happy RPG Making~ 😂
@caethyril One thing that I just recently noticed:

For some reason, the healing modifier does not seem to work properly.
So I experimented around for a bit and found out that this code does not work:
(That's the original code that you gave me)

JavaScript:
if (user.isEnemy() && target.isEnemy() && value < 0 && !this.isMpEffect) {
value = Math.max(value * 0.5, value + 10);
}

And after some testing, it seems that !this.isMpEffect is the culprit.
If I use the following code, the value gets modified as it should be:

JavaScript:
if (user.isEnemy() && target.isEnemy() && value < 0) {
value = Math.max(value * 0.5, value + 10);
}

I am not sure what causes this as !this.isMpEffect is proper code to my knowlegde

Luckily this is not a detrimental problem and it's not that much of a problem if this cannot be resolved for whatever reason. I'll just make enemies heal more MP then to balance out the heal modifier.
Oh, yes! You need brackets after it, i.e.
JavaScript:
if (user.isEnemy() && target.isEnemy() && value < 0 && !this.isMpEffect()) {
  value = Math.max(value * 0.5, value + 10);
}
This will tell it to evaluate the isMpEffect method and reference the result, rather than referencing the function itself. 🙂

I'll go edit that into my previous post to avoid confusing future people~

More details: isMpEffect is a method on instances of Game_Action. !this.isMpEffect is true if that method is not defined on this...which will never happen, because this is an instance of Game_Action. !this.isMpEffect() will evaluate the method based on this action instance, then "not" the result.
Just tried it out and it works now!
Thank you again @caethyril 😂

Original thread: https://forums.rpgmakerweb.com/threads/help-configuring-yep_damagecore-damage-steps.129167/