I've done prod token stacking, but in a very spaghetti way that relies on a certain condition. I did it in the InvSwapHandler. I basically checked if the item being swapped was one of the pre-defined tokens by dividing the item name into an array and checking the first few to make the token name itself matched. Very spaghetti. If both items passed as tokens, it would get the Quantity value of each and simply add them, which a check to make sure it wasn't going over the stack limit. If it went over the stack limit, it'd stack the tokens and put the deficit in the initial swap slot. I'd then use the string I divided into an array and change the last number to whatever the new quantity was, and return that item. This is probably one of the worst ways of doing token stacking possible, though.
E.g. Player tries to stack 'Moss Token x 2' with 'Moss Token x 5'.
They both pass as tokens, so it gets the Quantity value for each of those tokens.
It then adds them together, and makes sure the Quantity value isn't over the item's max stack. If it is, it makes en1 the deficit, and en2 the maxed stack.
It then creates two strings that are the names of the items to be given, if there is a deficit, and only one if there is no defecit.
It uses the array to stitch together a name, so it would take 'Moss Token x' and then add ' 7' to the string. It would convert that name to an item ID and give the item to the player.
This is probably the worst way of doing it. I don't have the code now, I accidentally wiped my entire source I had been working on, but I could probably make it again.
It's really spaghetti, and only gets worse with time, but the only thing really added is the name of the token, e.g. you'd have to add another name to the name array every time you added a new token, and that's it. If you add a lot of tokens I might see this causing a bit of lag.