Calculated field: (field A date - Field B date)/(Field C number)

Dear Bubble Community,

I am building an app’ to automate my commercial real estate invoices. I have an issue to calculate a field in my database. I have a backend workflow creating some new data.
In Commercial Real Estate, at the beginning of the rent you may give some free rent months, time for your tenant to some work and adapt the office space you are renting him.

In terms of data, if I send an invoice every 3 months (quad) and gave a 2 months free renting it means that the first invoice will be (1/3 x rent amount).

I have issues calculating the discount as I would like to do
Invoice discount = (“lease start date” - “free rent period end date”) / (“invoice intervals”).

This calculation does not seem possible in Bubble: what turnaround can I use? Any plugin/method you can advise?
I will need this kind of calculation for other use-cases like updating the rental.

(of course I have a “when” condition to know if this discount needs to be applied or not)