- Joined
- Aug 11, 2025
- Messages
- 88
- Reaction score
- 22
- First Language
- English
- Primarily Uses
- N/A
So this is all a new thing for me, I have little to no idea how to officially code besides some very basic stuff, however, I did figure out how to do something that have been bothering me for a while now in RPG maker MZ, I figured out how to make chip damage (sorta)... so in rmmz_objects.js line 1957 to 1971 it says:
};
Game_Action.prototype.evalDamageFormula = function(target) {
try {
const item = this.item();
const a = this.subject(); // eslint-disable-line no-unused-vars
const b = target; // eslint-disable-line no-unused-vars
const v = $gameVariables._data; // eslint-disable-line no-unused-vars
const sign = [3, 4].includes(item.damage.type) ? -1 : 1;
const value = Math.max(eval(item.damage.formula), 0) * sign;
return isNaN(value) ? 0 : value;
} catch (e) {
return 0;
}
};
NOW this is good because on line 1966 it says:
const value = Math.max(eval(item.damage.formula), 0) * sign;
if you write in a 1 instead of a 0 such as:
const value = Math.max(eval(item.damage.formula), 1) * sign;
it makes the minimum damage number to 1!
this is wonderful as I hate the damage doing 0 (just my preference) but here's why I'm writing this thread as I've already made this into a working plugin and called it Chip_Damage.js
HOW DO YOU MAKE PARAMETERS!?
my goal is to have it so I can change the number not just to a 1... but to ANY number I want using in game parameters to ether
1. be able to just change it without re-coding the plugin each time OR
2.be able to use the plugin command to change it on the fly mid game
so to sum this all up, I just need some tips and advice of how I can make it so the number 0 in the line of code that is:
const value = Math.max(eval(item.damage.formula), 0) * sign;
can be changed in game with a parameter in the plugin menu.
if anyone can offer support it would be a TON of help to me!
};
Game_Action.prototype.evalDamageFormula = function(target) {
try {
const item = this.item();
const a = this.subject(); // eslint-disable-line no-unused-vars
const b = target; // eslint-disable-line no-unused-vars
const v = $gameVariables._data; // eslint-disable-line no-unused-vars
const sign = [3, 4].includes(item.damage.type) ? -1 : 1;
const value = Math.max(eval(item.damage.formula), 0) * sign;
return isNaN(value) ? 0 : value;
} catch (e) {
return 0;
}
};
NOW this is good because on line 1966 it says:
const value = Math.max(eval(item.damage.formula), 0) * sign;
if you write in a 1 instead of a 0 such as:
const value = Math.max(eval(item.damage.formula), 1) * sign;
it makes the minimum damage number to 1!
this is wonderful as I hate the damage doing 0 (just my preference) but here's why I'm writing this thread as I've already made this into a working plugin and called it Chip_Damage.js
HOW DO YOU MAKE PARAMETERS!?
my goal is to have it so I can change the number not just to a 1... but to ANY number I want using in game parameters to ether
1. be able to just change it without re-coding the plugin each time OR
2.be able to use the plugin command to change it on the fly mid game
so to sum this all up, I just need some tips and advice of how I can make it so the number 0 in the line of code that is:
const value = Math.max(eval(item.damage.formula), 0) * sign;
can be changed in game with a parameter in the plugin menu.
if anyone can offer support it would be a TON of help to me!


