How to Extend and Override Core functionality like taxes_and_totals

Hi. I am trying to extend the taxes_and_totals classes but its not working. I have used below code in my custom_taxes_and_totals.js file:

console.log("Custom Taxes and Totals Script Loaded..");
erpnext.taxes_and_totals = class CustomTaxesAndTotals extends (erpnext.taxes_and_totals){
    calculate_net_total() {
        console.log("Custom calculate_net_total method called.");
    }
}

and in my custom app hooks.py i have added:

app_include_js = [
     "/assets/eiccustom/js/custom_taxes_and_totals.js",
 ]

When loading Sales Invoice Page, “Custom Taxes and Totals Script Loaded…” this message is printed but override method calculate_net_total is not executing rather the main class calculate_net_total is executed.

Am i doing anything wrong?

Please check the reference: How to override standard js class - #6 by NCP

Is there any difference with this? Also i checked it and tested the same way. Result are same. No impact. I am using

ERPNext: v15.32.0 (version-15)
Frappe Framework: v15.38.0 (version-15)

Finally i solve it using below code:

extend_cscript(cur_frm.cscript, new erpnext.accounts.SalesInvoiceController({ frm: cur_frm }));