Custom Script | Auto Compensatory Leave

Hello friends,
Newbie here, I’m trying to figure out a way to automatically apply compensatory leave if found attendance is “Absent” but was “Present” on their holiday within that month.

Basically, we want to give employees flexibility with their holidays. Our workplaces are open every day and employees can take their weekly vacations on fixed holidays or some other day.