No, I get what you're saying. This still serves the same function.
So like when you give your player Residuum, give it to them as the hidden item like explained above.
So even if you give them a lot, the amount you get is tied to that variable since the variable is == to the game data of the item.
So if you get 1,000 Residuum from a monster drop. The variable updates accordingly to the amount you have in your inventory. Just make it a hidden item so that the player can't see it as an item in their inventory and have it display however you're currently displaying it.
Now, you just take on the item as a requirement for crafting.
So the ingredients would include your item which is just a way to store your currency variable.
And item stacks can be easily broken with Yanfly's plugins lol.
EDIT: lol decided to just try and explain it in video form.
▶ YouTube video