Crit chance in damage formula

In rpg maker vx ace thier was a formula you could put in the damage formula bar thing that could let you add a specific crit chance to the skill. is thier something like this in MZ?

Thank you in advance
Maybe something like this (untested):

let r = a.atk * 4 - b.def * 2; if (Math.random() < 0.2) { b.result().critical = true; r = this.applyCritical(r); }; r​

  • Store the usual formula result, whatever it is, in a temporary variable named r;
  • Math.random() < 0.2 should be true 20% of the time;
  • b.result().critical = true triggers the crit visual effects/message;
  • r = this.applyCritical(r) applies the normal critical multiplier to r.
    • You could do something like r *= 3 here (i.e. "multiply r by 3") instead if you want.
  • Finally, return the value of r.
I think it has to be done separately like this because the crit result is passed into makeDamageValue as a fixed value, before the formula gets evaluated.
I think it's not possible. Crit had been decided before damage calculating
Maybe something like this (untested):

let r = a.atk * 4 - b.def * 2; if (Math.random() < 0.2) { b.result().critical = true; r = this.applyCritical(r); }; r​
Thanks i'll try this out

@vietanhdang2017 you could in VX Ace
I think it's not possible. Crit had been decided before damage calculating
Just because it was decided doesn't mean it can't be changed, as caethyril did.

And since it being a critical doesn't do anything until after the damage is calculated (you can't print large text of the damage that doesn't exist yet), I suspect this will work.

However, make sure you turn Critical Hits off on the skill page in your database. You wouldn't want the engine to decide it's a critical, multiply the damage, then you multiply it again inside your formula.

Original thread: https://forums.rpgmakerweb.com/threads/crit-chance-in-damage-formula.140516/