Yanfly's YEP_CoreEngine. Display "Current/Max" item in both Shop (Buy/Sell) and Inventory Menus (RMMV)

So I'm using a function in YEP_CoreEngine that allows you to limit the amount of specific items that you can carry (<Max Item: x>), and I like this function a lot as it prevents spamming items or hoarding them. The problem is, it does not display the limit of how much of a specific item that you can carry, and I cannot figure out how to reprogram so that is does display it. It'll be bad game design if the player does not know the max amount of a specific item that can be carried and could cause unnecessary frustration when playing my game.

And before anyone asks. Yes, I did look it up and found this thread, I tried the solution shown in it and it did not work (While using the script that specific solution was made for). If it did, I would not be posting this.

Here's how I want it done. Let's say you go to a shop to buy an item, be it a regular item, weapon, armor, etc., and the shop tells you how much of this item you have and how much of this item you can carry up to. For Example, let's say I programmed the limit on my health potions to be so that the player can only have up to 10 health potions at any given moment, so if I go to a shop to and want to buy health potions, I should see something like this.

Health Potion $10 4/10 (Where "4" is the current amount of health potions I have and "10" is the max amount I can carry). Same thing should appear when I sell too so that the player can calculate how much of an item they should keep and how much they should sell.

The same thing would also show up when I go to look at inventory through the menu screen. Like this.

Health Potion 4/10

That is all I want, and I'll be eternally grateful to anyone who can help me with this.

EDIT: Just realized that other thread I posted that had a similar problem was related to something done in VX Ace and not MV, my mistake.

I've moved this thread to Javascript/Plugin Support. Thank you.

Moved to: Javascript/Plugin Support
Sorry, it's kind of confusing to me what type of thread goes where on here.
@Shaz Excuse me, since you solved a similar problem a while back for a VX Ace user, maybe you help me on this one, please?
Bump
Adding my own interest in a solution to this problem, as I am also looking to do something similar in my own game.

For additional detail, you've already got the max items working, correct? As in, you're already at the point where the player cannot get more than 10 items, you're just looking to display this to the player?
Do you want to know what to edit into the original plugin to achieve this, or would you prefer a standalone patch plugin that will modify the shop windows?
Adding my own interest in a solution to this problem, as I am also looking to do something similar in my own game.

For additional detail, you've already got the max items working, correct? As in, you're already at the point where the player cannot get more than 10 items, you're just looking to display this to the player?

Yes, that's correct. I got the max items working, that part is extremely simple. Yanfly's Core_Engine allows you to do that by putting <Max Item: X> in an object's notetag to add a limit to it.

What it doesn't do is display the max amount the player can hold of that item. For example.

Instead of.

Health Potion x4

I want.

Health Potion x4/10.

4 is the current stack, 10 is the max stack.

That thread I linked above was on the same subject but done in VX Ace, I'm looking to do the same thing but in MV.
Do you want to know what to edit into the original plugin to achieve this, or would you prefer a standalone patch plugin that will modify the shop windows?

Either one would do.
Either one would do.

The quickest way to do it:

In YEP_CoreEngine.js, look up Window_ItemList.prototype.drawItemNumber and change the second-last line to

Code:
this.drawText('\u00d7' + numItems + "/" + item.maxItem, x, y, width, 'right');

Then in the default rpg_windows.js, look up Window_ShopStatus.prototype.drawPossession and change the last line to

Code:
this.drawText($gameParty.numItems(this._item) + "/" + this._item.maxItem, x, y, width, 'right');

(note that this assumes you have no other plugins that affect these functions; if you do, you'll have to edit the code in those instead)
The quickest way to do it:

In YEP_CoreEngine.js, look up Window_ItemList.prototype.drawItemNumber and change the second-last line to

Code:
this.drawText('\u00d7' + numItems + "/" + item.maxItem, x, y, width, 'right');

Then in the default rpg_windows.js, look up Window_ShopStatus.prototype.drawPossession and change the last line to

Code:
this.drawText($gameParty.numItems(this._item) + "/" + this._item.maxItem, x, y, width, 'right');

(note that this assumes you have no other plugins that affect these functions; if you do, you'll have to edit the code in those instead)

HAHAHA YES!!! Thank you!!! Works like a Charm! You get a free copy of my game (Whenever I'm done with it).
HAHAHA YES!!! Thank you!!! Works like a Charm! You get a free copy of my game (Whenever I'm done with it).
I'll hold you to that. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/yanflys-yep_coreengine-display-current-max-item-in-both-shop-buy-sell-and-inventory-menus-rmmv.123277/