This is a backport of tfarecnim's Balanced Enchanting
It uses SpongePowered Mixin to do its stuff (in case of unexpected behavior)...
Warning: This mod was tested only in Single Player mode!
Overview:
In vanilla Minecraft, the cost to enchant tools/armor is always a set number of levels, no matter what your current level is. For example, making a max level enchant in the enchanting table will always cost 3 levels, regardless of if you're level 30 or level 300. But the amount of xp required to gain a level increases linearly so the same enchantment at level 300 costs 50x more points than at level 30.
This mod makes it so that enchantments and anvil operations at any level costs the same fixed amount of points, demonstration below:

Please, leave a comment if it works on your machine, too.