Subtract, divide and round down
Spendable resource is the larger of zero and budget minus reserve. Divide it by the equal cost and round down to a whole attempt. Any remainder stays visible. This answers a budget question, not whether a random result will suit your role.