Change value custom product Tag

Thank you for your script. I wanted to used it for product stop-list tag that can be used to set quantity of each product that can be sold and when that tag reaches 0 it will not allow to put that product in ticket. This script allows me to decrease stopTag quantity only once when ticket is opened, not everytime product placed in ticket. When ticket is reopened and product is placed to ticket, again it decreases tag quantity only one time . What can be the issue? Or is there any built-in SambaPOS function to make it work?