- Joined
- Nov 29, 2021

- Messages
- 3

- Reaction score
- 2

- First Language
- Portuguese

- Primarily Uses
- RMMZ

I'm using VisuStella's amazing plugins in my project and so far I'm loving that they are giving me new and interesting options to customize gameplay. I'm running into a stone wall though, and that is I can't customize the damage formula in the way I'm intending. Inside the Battle Core plugin, in Damage Settings > Critical Hits > Damage Formula, I've customized the formula into this:

// Declare Constants

const user = this.subject();

let damage = arguments[0];

**let multiplier = 1 + ((this.subject().luk)/(300))**;

let bonusDamage = 0;

// let multiplier = 2.0;

// let bonusDamage = this.subject().luk * this.subject().cri;

// Return Damage

return damage * multiplier + bonusDamage;

This is my current formula. It works great so far as LUK has a very significant effect on critical hit damage. The problem with it, though, is that I would really like LUK to be both an offensive and a defensive stat (similar to how it already slightly increases the chances of you inflicting a negative status as well as avoiding it).

Then my idea was to change this formula into the following:

**let multiplier = Math.min(1 + ((this.subject().luk)/(TARGET's LUK)), 4)**

In this formula, the damage dealt by critical hits would float between x1 to x4 the amount of a normal hit, depending on both the attacker's and the target's LUK stats.

This could give a much necessary edge to my feeblish Rogue and Healer classes with their high LUK stats, in that they would be dealing more damage with critical hits (DPS edge over Warrior classes considering the high AGI of Rogues) while also taking less damage from them (so they can withstand damage from high-critical hit enemies better than Mage classes).

The problem is I don't know how to reference the "TARGET'S LUK" part in this formula, I've tried "target.luk", as I've seen other parts of the script use this type of notation to use target's stats in calculations. However, that simply returned an error when I playtested it.

What should I do? I have little to no knowledge of Javascript and the RMMZ base engine plugins (scripts?), nothing besides the mathematical operations/notations and a rudimentary understanding of how some functions work, so I don't know if this is a stupid question (I'm sorry, if that's the case). Thanks in advance!