Item won't be crafted only once.

I tried to make it so this item can be crafted only once (this is just a placeholder for now) by giving an advancement once it's crafted. It then sets the scoreboard to 0, and if it finds it at 0, it clears the recipe result and refunds the player. Attached is the datapack incase anyone wants to take a look.
Continue to help post