In the early beta days of Minecraft, using the wrong tool for the wrong job would deduct 2 points from your tools' durability as penalty. This included using axes, shovels, hoes and pickaxes as weapons, which weren't supposed to be used as weapons.
In Minecraft 1.9 The Combat Update, axes, shovels, hoes and pickaxes were changed to be valid weapons, but the "wrong tool" double durability penalty never changed. This tiny datapack fixes that oversight.
Starting in v2, the datapack now considers your level of unbreaking and the change in durability, using the following table:
There are no ticking functions and it's multiplayer friendly.