Change state icon size

Hey guys, I'm drawing a blank... I changed the size of my state icons from 32x32 to 96x32...

Now how do I have to change this function in sprites.js so I get the right icon?

Sprite_StateIcon.prototype.updateFrame = function() {
var pw = Sprite_StateIcon._iconWidth;
var ph = Sprite_StateIcon._iconHeight;
var sx = this._iconIndex % 16 * pw;
var sy = Math.floor(this._iconIndex / 16) * ph;
this.setFrame(sx, sy, pw, ph);
};

I'm sorry, it's probably simple but I've been on this issue since 3 hours...
You might need to be more specific in terms of exactly what you have already done, but have you tried this?
Code:
Sprite_StateIcon._iconWidth  = 96;

Also, a note: it is generally inadvisable to edit the core scripts directly, since that makes it unnecessarily difficult to track edits and be certain of compatibility with third-party code. 👋 In case you're unaware: you can put overrides in a .js file and import as a plugin. Much neater that way! 🙏
thanks for your help @caethyril also what a nice username!

EDIT: OH I figured it out!! It was:

Sprite_StateIcon._iconWidth = 96;

Sprite_StateIcon.prototype.updateFrame = function() {
var pw = Sprite_StateIcon._iconWidth;
var ph = Sprite_StateIcon._iconHeight;
var sx = this._iconIndex % 16 * 32; //moni
var sy = Math.floor(this._iconIndex / 16) * ph;
this.setFrame(sx, sy, pw, ph);
};

So can I just copy this into a new .js file like this, or do I need to add:


function Sprite_StateIcon() {
this.initialize.apply(this, arguments);
}



Sprite_StateIcon._iconWidth = 96;

Sprite_StateIcon.prototype.updateFrame = function() {
var pw = Sprite_StateIcon._iconWidth;
var ph = Sprite_StateIcon._iconHeight;
var sx = this._iconIndex % 16 * 32; //moni
var sy = Math.floor(this._iconIndex / 16) * ph;
this.setFrame(sx, sy, pw, ph);
};

};

Or do I have to copy the whole function Sprite_StateIcon() { into a new js file?
Try both and see what happens? 🙂

Spoiler
Only the function you want to overwrite

Original thread: https://forums.rpgmakerweb.com/threads/change-state-icon-size.111617/