MV Help with Plug in

I had chat GPT create a plug in for my game. Its supposed to add a 5% crit and eva bonus for every 10 levels of luk and do so in a way that if a players luk stat drops below a threshold in battle it will update. e.g player has 22 luk and receives a -5 luk debuff their bonus will drop from 10% to 5%

Here is what I have:

/*:
* @plugindesc Adds bonus to crit rate and evasion rate based on LUK stat.
* @Help This plugin gives a 5% bonus to crit rate and evasion rate for every 10 levels of LUK.
*/

(function() {

// Create a function to calculate the bonus
function calculateLukBonus(luk) {
return Math.floor(luk / 10) * 5;
}

// Extend the Game_BattlerBase class to include the LUK-based bonus
var _Game_BattlerBase_cri = Game_BattlerBase.prototype.cri;
Game_BattlerBase.prototype.cri = function() {
var baseCri = _Game_BattlerBase_cri.call(this);
var lukBonus = calculateLukBonus(this.luk);
return baseCri + lukBonus / 100;
};

var _Game_BattlerBase_eva = Game_BattlerBase.prototype.eva;
Game_BattlerBase.prototype.eva = function() {
var baseEva = _Game_BattlerBase_eva.call(this);
var lukBonus = calculateLukBonus(this.luk);
return baseEva + lukBonus / 100;
};

})();


If anyone knows what I'm missing or can help me tweak this for what I need Id really appreciate it.
Welcome!

I had chat GPT create a plug in for my game.
That's not a very good idea. A.I. can't really create logical things - if something has been done before, they can try to look it up, or it can make up nonsense, but it can't really make new stuff that makes sense.

In this case, it's extending two functions that don't exist at all, and writing a new one that's sheerly pointless as it's a single command.
That's good to know thank you for clarifying this. I've heard of people using it to help with scripts, and it's helped me with some scripts as well. I thought if it could do that a plug in for something like this would've been simple.
it can help if you know what it does and help you pinpoint, but we don't
help people with AI generated code.

if you need something and don't know JS or how to add something,
it's better to ask, human coders are 10x better and that knows the engine
to modify or extent what you need.

Eliaquim has some plugins that can add custom parameters that can do
exactly what you want. so check here as his MV plugins is free, and this one
was free, it's better to read that plugin and add what you need 🙂

so we don't need to make a new plugin if it's out there ^^
Dude thank you so much this is awesome! I'll be sure to check It out

Original thread: https://forums.rpgmakerweb.com/threads/help-with-plug-in.169522/