MZ Visustella Elements Status Core help trying to get States Category.

Hello again. I'm trying to find a way to get a 'category' of 'states' listed that is basically the same as the default 'elements' 'category' in the plugin but with states instead of elements.

In the plugin under Status Menu Categories in the Plugin Parameters there's an option to list elements (and bonus damage and resistances) but not states like in YEP (where it showed state resistances in a menu) and I'm trying to duplicate that. I just straight copied the JS for the elements category and changed all the words that said element or elements into state or states hoping for a long shot which of course doesn't work...

Screenshot below will hopefully make more sense. Basically I want that same list but for states as well in a separate category. I have the category next to it but it's the same info as in the elements as it's just a placeholder. I tried editing things here and there but it's a lot of code and my JS is not that great. It doesn't have to have the "bonus damage" section because I know states don't work like that but maybe it would say "inflict" instead of bonus damage and then have a list of states that that character can inflict and the % of them being able to inflict it.

Is anyone familiar with the plugin that knows how to do this or has done it? Maybe not the place to say this but I'd be willing to pay for it if need be. Thanks.
It would help if you showed what you tried for JavaScript, then we could see what was incorrect and offer suggestions.

As general things, you can use actor.stateRate(ID) to see the decimal modifier for the actor to receive that state.

And then actor.stateResistSet() returns an array of IDs that the actor resists (i.e. is immune to).
Oh yeah, I should have done that in my OP. Here's the code it comes with in the plugin parameters under the status menu categories, states, and JS: draw data.

By default, most of the '//' were not there, I added those to get the look I was going for in the screenshot and it didn't mess anything in the plugin up. I wanted the same thing essentially for states.

It doesn't show here but I basically changed anything that said 'element' to 'state' and anything that said 'elements' to 'states' and anything that said 'elementId to 'stateId' hoping it would be that easy but of course it wasn't and it would crash and I tried changing a few things here and there like using 'StateId,' 'stateID,' 'statesId,' and other variations of upper and lower case to the same errors. Eventually I just recopied the 'elements' code below just so the game wouldn't crash. So the below code works flawlessly for elements but I want it for states.

// Declare Constants
const lineHeight = this.lineHeight();
const actor = this._actor;
const padding = this.itemPadding();
let width = this.innerWidth / 2;
const elements = this.getElementIDs();
let x = 0;
let y = 0;

// Draw Actor Graphic
//this.drawActorGraphic(0, width);

// Draw Element Trait Sets
//this.drawItemDarkRect(0, y, width, lineHeight, 2);
//this.drawItemDarkRect(width, y, width, lineHeight, 2);
//const labelFmt = '\\C[16]%1: \\C[0]%2';
//const traitType1 = DataManager.traitSetType('Element');
//const traitSet1 = actor.traitSet('Element');
//this.drawTextEx(labelFmt.format(traitType1.Label, traitSet1.Display), //padding, y, width - padding * 2);
//const traitType2 = DataManager.traitSetType('SubElement');
//const traitSet2 = actor.traitSet('SubElement');
//this.drawTextEx(labelFmt.format(traitType2.Label, traitSet2.Display), //width + padding, y, width - padding * 2);
//y += lineHeight;
//this.setDescriptionFontSizeToTraitSet();
//const traitHeight = (this.innerHeight /

Math.max(Window_StatusData.traitCol1.length, Window_StatusData.traitCol2.length)) - lineHeight;

//this.drawItemDarkRect(0, y, width, traitHeight);
//this.drawItemDarkRect(width, y, width, traitHeight);
//this.drawTextEx(traitSet1.Description, padding, y, width - padding * 2);
//this.drawTextEx(traitSet2.Description, width + padding, y, width - //padding * 2);
//this.resetDescriptionFontSize();
//this.resetFontSettings();
//y += traitHeight;
//const topY = y;

// Draw Elemental Data
this.drawItemDarkRect(width * 0, y, width, lineHeight, 2);
this.drawItemDarkRect(width * 1, y, width, lineHeight, 2);
this.changeTextColor(ColorManager.systemColor());
this.drawText(TextManager.statusMenuDmgReceive, width * 0, y, width, 'center');
this.drawText(TextManager.statusMenuDmgDealt, width * 1, y, width, 'center');

y += lineHeight;

this.setDescriptionFontSizeToTraitSet();
const smallLineHeight = this.textSizeEx(' ').height;
for (const elementId of elements) {
this.drawItemDarkRect(width * 0, y, width, smallLineHeight);
this.drawItemDarkRect(width * 1, y, width, smallLineHeight);
// Name
const name = $dataSystem.elements[elementId];
this.drawTextEx(name, width * 0.5 + padding, y, width/2);
this.drawTextEx(name, width * 1.5 + padding, y, width/2);

// Received Damage Rate
this.resetFontSettings();
const rate = actor.elementRate(elementId);
const flippedRate = (rate - 1) * -1;

this.changeTextColor(ColorManager.paramchangeTextColor(flippedRate));
let rateText = '%1%'.format(Math.round(flippedRate * 100));
if (actor.getAbsorbedElements().includes(elementId)) {
this.changeTextColor(ColorManager.powerUpColor());
rateText = TextManager.statusMenuDmgAbsorb.format(Math.round(rate * 100));
} else if (rate > 1) {
rateText = '%1'.format(rateText);
} else if (rate <= 1) {
rateText = '+%1'.format(rateText);
}

this.contents.drawText(rateText, width * 0, y, width / 2 - padding, smallLineHeight, 'right');

// Dealt Damage Rate
const dealtPlus = actor.getDealtElementPlus(elementId);
const dealtRate = actor.getDealtElementRate(elementId);
const dealtFlat = actor.getDealtElementFlat(elementId);
const dealt = ((1 + dealtPlus) * dealtRate + dealtFlat) - 1;
this.changeTextColor(ColorManager.paramchangeTextColor(dealt));
let dealtText = '%1%'.format(dealt);
if (dealt >= 0) dealtText = '+%1'.format(dealtText);

this.contents.drawText(dealtText, width * 1, y, width / 2 - padding, smallLineHeight, 'right');
y += smallLineHeight;
}
this.resetDescriptionFontSize();
this.resetFontSettings();
this.drawItemDarkRect(width * 0, y, width, this.innerHeight - y);
this.drawItemDarkRect(width * 1, y, width, this.innerHeight - y);
this.drawItemDarkRect(width * 2, y, width, this.innerHeight - y);

Usually the error was some sort of 'this.getStateIDs is not a function' or some variation thereof. Thanks for any other help you can give and for the help you've already given.
Yeah, all of those element-specific functions don't have a state counterpart.

You also don't want to loop through and display the info for every state in your game because that will probably produce a lot of junk on the screen that isn't pertinent to the player.

You want to choose which specific states you want to show information about and use the functions I gave you in my previous post to display information. You can see where the code you have uses elementRate() and produces a "flipped" version to display a resistance percentage - that would all work with the stateRate() function I referenced before.

But there's no definition in $dataSystem for states, they have their own $dataStates category; there's no such thing as an "absorbed" state, etc.

You just need to go through it with a bit more intent and thought, you can't just search and replace text because it doesn't all mean the same thing.
Ok then. Thanks for the pointers and help ATT. I still don't really know what I'm doing but I think you've given me enough to work with where I think I can at least play around with it where I'm not so in the dark and use the code you've given me to mess around with it until it works or at least gets close to what I'm envisioning.

Thank you. I've noticed you're always on these boards helping people and I know I, and many others likely, appreciate it.

Original thread: https://forums.rpgmakerweb.com/threads/visustella-elements-status-core-help-trying-to-get-states-category.156605/