I want to customize the way payment days are calculated in ERPNEXT

Context:

I have a salary structure with two components - Basic Salary (Depends on Payment Days) and House Allowance.

Here is the formula for House Allowance:

0.15*base if payment_days >= 14 else 0.15*BS

where BS is the Basic Salary.

I have a (Paid) Leave Type called Sick Leave. Let’s say out of 26 working days in a month, the employee worked for 12, and took 3 paid leave. When that 3 paid leaves are taken, the payment days in the salary slip becomes 15 which in turn affects the calculation of House Allowance as well. I don’t want the paid sick leaves to affect the House Allowance calculation. It should be calculated using the *actual* number of days worked. Is this possible?

I want the Sick Leave money to be paid separately to the employee. For this I think I will have to create a separate salary component for show the amount there. Is this somehow possible out-of-the-box?