Custom script help on adding WFH hours to Timesheet

Hi Team, I am quite new to this tool.
I have modified my Timesheet to display 4 fields like Office clock in and office clock out time. Which by default is from_time and to_time under Timesheet Detail.
I have added 2 custom fileds as WFH clock in and WFH clock out time. The time i track here should get added to Hrs(hours) in Timesheet detail and to Total Working Hours(total_hours) in Timesheet.

Can you please help me achieve this. TIA.