Does mining prod work for this?
If not, you can probably add it by doing x = x + (mining prod) on every mining event, and when it goes above 1, sub 1 and add an extra ore. Do it per ore, per surface, should be good enough.
Yes, this mod accounts for mining productivity. When calculating the amount of ore to deduct from the source, it deducts ore count spawned / (1 + productivity).
Unlike mining drills, this does mean productivity does not increase mining speed.