Dynamic Onchange field name

Dear All,

I am using on-change event on the custom script of doctype, now i want to take this on-change field name dynamically.

function Onchange(TableName,OnchangeField){
frappe.ui.form.on(TableName, {

OnchangeField: function(frm,cdt, cdn){
    //logic
}

});
}
Onchange(“Employee”,“score”);

now I want to pass the value of OnchangeField through function, any solution because it is not working.

Regards,
Vishakha