MV [SOLVED] Helping with the Simplest Item Discard Script

Hi everyone, I'm would like to have for my game a simple "discard option" in item menu. Or an option that could be called even outside the menu (exemple when taking a new item from the ground, script call to open the discard window).

In the first case (add option in item menu from menu), have 2 choices:

On Discard option, simple remove 1 quantity of the item selected.
On Use option, simple use default code with the code:

if (action.isForFriend()) {
this.showSubWindow(this._actorWindow);
this._actorWindow.selectForItem(this.item());
} else {
this.useItem();
this.activateItemWindow();
}

In the second case (call script), show Item list window then discard the item selected (like using it on noone?) I think the second case should be much simpler maybe? I think one could copy the default code to open via script call the item list window, then change the "useItem function" to do nothing other then "consume" the item?


Thank you so much in advance ;_;
Found a solution!

Original thread: https://forums.rpgmakerweb.com/threads/solved-helping-with-the-simplest-item-discard-script.130136/