How to configure different Purchase Tax Rate based on price?

Based on the price of a given item, Purchase Tax will vary.

For instance, for all items below 999, a tax of 5% is applicable. Any item above 999 has a tax of 12%.

How can this be configured?

Try this

frappe.ui.form.on('Purchase Order Item', {
    item_code: function(frm, cdt, cdn) {
        var row = locals[cdt][cdn];
        if (row.item_price < 999) {
            frappe.model.set_value(cdt, cdn, "taxes_and_charges", "Purchase Tax 5%");
        } else {
            frappe.model.set_value(cdt, cdn, "taxes_and_charges", "Purchase Tax 12%");
        }
    }
});