1.12.1 Ore rarity datapack

My goal is to change the ore rarity for 1.12.1, I found a datapack which does this for one of the older versions and does not work anymore. Is there a good way of getting a "complete" template for the newest version, or where can I learn how to format the datapack properly to accomplish this goal? If It's not a removed feature, of course.
Continue to help post