MV Creating a custom inventory

I've recently started looking into how to code for my projects, and was looking about some advice.
I'm aiming to make an inventory with several categories, some which exist in more than one type. (I.e. an apple is both "food" and "ingredient"). I was planning on doing this with notetags.

The first section is setting the notetage categories to the items.

Spoiler: Collecting notetag info
const Game_Item_setup = Game_Item.prototype.setup

Game_Item.prototype.setup = function(itemID) {
Game_Item_setup.call(this, itemID);
this.category = $dataItems[itemID].meta.category
Spoiler: Collecting notetag info
|| null
The custom inventory tab buttons would then set a variable to a set value that would match a category, using $gameVariables.setValue(1) = = '1'

This would then affect the item list generated
Spoiler: Item list
Window_ItemList.prototype.includes = function(item) {
switch($gameVariables.value(1))
case '1'
return DataManager.isItem(item) && item.category = 'ingredient'
case '2'
return DataManager.isItem(item) && item.category = 'food'

I'm away from my computer for a while, so I'm having to handwrite this and can't check the results. Would someone be able to tell me if I'm headed in the right direction?


Edit 1: not sure why it's splitting off the null from the first spoiler. My apologies

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-custom-inventory.146520/