This is a request for a simple mod, one which contains just one block, the Anvil Repair Cost Reducer (ARCR).
The ARCR is Crafted from an Anvil, and an Enchantment Table, adjustable with from a config file, or perhaps MineTweaker.
It looks very much like an Enchantment Table, minus it's book.
When the player right clicks the ARCR with an item, the ARCR takes the item away from the player, and transforms it into an Item Entity, and sets the following data tags: NoGravity:1, Age:-32768, PickUpDelay:6000. It also sets the location the Item Entity so that appears to be "sitting on" the block, and the block changes it's own metadata so that it knows that an item has been "put onto" it. Only one item can be "put onto" an ARCR at a time.
Right clicking the ARCR with an empty hand sets the NoGravity, Age, and PickUpDelay tags of the Item Entity to zero, and resets it's own metadata.
When the ARCR is given a random block tick by the world (it's randomTickMethod is called), and it has an item "on it", then it will try to reduce the repair cost of the item (using the getRepairCost and setRepairCost methods of ItemStack):
When the ARCR turns an item's repair cost to a positive number, it emits some small particles, and sets the PickUpDelay of the Item Entity back to 6000.
When the ARCR turns an item's repair cost to zero, it emits some large particles, and plays a happy sound, and changes it's own metadata so it color is different (and so it "knows" that the item is fully processed), and sets PickupDelay of the Item Entity to zero.
If the item's repair cost is already zero, it repeats the sound and the large particles.
If the ARCR gets a block tick and it has no item on it, it does not do anything.
The ARCR can be read by a redstone comparator. If there's no item on it, the result is zero. Otherwise, the output is 1 plus the item's repair cost.
The ARCR has no TileEntity. It does not need one.
And, that's it. It doesn't need to do anything else. I said it was simple, didn't I?
Actually, it needs a config file to adjust the height of the Item Entity, just in case it is used in a modpack with the ItemPhysic mod.
Yes, the average rate of block ticks is one per 68 seconds. As a result, the ARCR is slow. That's deliberate (no pun intended).
You can use "/gamerule randomTickSpeed <number bigger than three>" to make it fast in vanilla.
There are existing mods which can call the randomUpdate method of arbitrary blocks, which can make the ARCR fast in a modpack. The eponymous torcherino. The acceleration wand from NEW. Certain poorly coded watering cans. Etc. There's nothing preventing you from using this with those.
If you aren't aware of why this block would be useful, simply repeatedly damage a weapon, then repair it on an Anvil. The XP cost of the repair goes up exponentially each time (literally). Once it's too high, you won't be permitted to perform the repair unless you're in creative.
With this mod, you would have a spare set of armor and tools, and one Anvil Repair Cost Reducer for each of these items. After you come back from an adventure, repair your damaged stuff, then swap the newly repaired items with the things which has been sitting on the ARCRs.
Also, it's good for reducing the costs for combining enchanted books on an anvil, etc.