Need Help Creating Due Dates Variable Days before Milestones

I am creating project plan templates for my team to copy and customize. I’d like to create a formula/automation where they would input a milestone date and all of the tasks that lead up to that milestone would be automatically filled in. Is there something like “#days before,” that would look at a column with a variable number and create a date that number of days before a milestone? For example: Milestone due date is 9/14/21, so task 4 would be 2 days before, task 3 would be 3 days before, task 2 would be 4 days before and task 1 would be 8 days before? What would that look like in terms of columns? Any help would be greatly appreciated.