Help for item modifiers

So I am trying to write a line of function to make an item that player holds will lose only 1 durability when executed. For example, if a player has an diamond sword in mainhand with 723 durability, it will reduce 1 and drop to 722 when the command executed.

I used ""item modify entity @s weapon.mainhand main:remove_durability"" command, where "remove_durability.json" is replaced in "item_modifiers" folder.

[ { "function": "minecraft:set_damage", "damage": 1 } ]

When I am writing this inside of the remove_durability.json and executing the code, it sets the item durability to 1. How should I rewrite inside the json file to make it reduce 1 durability per each execute?

Continue to help post