pub(super) fn optional_cost_spend( base_cost: f64, maximum_cost: f64, current_resource: f64, ) -> f64