HR: Salary Slip Based On time sheet

To calculate the overtime, I am using salary slip based on time sheet.
But I do not need to enter the rate hour as a fixed amount (for example 100$), but I need it to be depending on equation like base * 2, because each employee has different hour price than other (depending on his salary of course). How I can achieve this?

Regards
Bilal

You would have to use custom script for this.

Thank you a lot.
But to be calculated for each employee, it is required to be run (executed) when we create salary slip or the payslip process. So the custom script to be applied on the salary structure or salary slip or salary (or salary process) and on which action?
Also what about if it is needed to be run when we are creating salary slip from the time sheet after we submitted it?
Regards
Bilal