I think so your scenario can be handled by Invoice Reduction function. Cash discount function does not fit in here since Cash discount is directly connected to the payment terms whereas in your case you decide the discount amount based on the delivery dates.
A invoice reduction can result in a Invoice with a total amount and a additional credit memo for the discount amount. In totality, the net outgoing amount will be the difference between the invoice nad credit memo.
Kindly explore this further.