Darza's does this by making all items a struct:
The actual count of the item is Item.Count + 1. Aka a count of 0 = 1 item. All items can be stored and sent as an Int32 by sending 2 bytes for the type, 1 byte for the count, and 1 byte for soulbound. The client should then add the text in the corner if the count is greater than 0. The text displays Item.Count + 1 for viewing purposes.
In the XMLs you should define a <MaxStack> element, then change the Swap handler to have something like this:
This does have some limits. The count can only go up to 255. You can change the count to an Int16/short if you want, and remove the soulbound data to have a larger count ceiling.
This code will not plug and play into your source though. You'll need to take the concept from it and apply it accordingly to yours.