Formula in Tax Slab

I’d like to add a formula section in the tax slab, similar to that found in the Salary component that can be used to make the tax slabs calculations more flexible.

Idea is to have Condition & Formulas.

Is this possible and what’s the best way of doing this? I’ve already modified the doctype to add the field. Are there any scripts I need to write so the tax slab calculation takes this into account?