Imo a clean general solution would be to define multiple component taxcodes as a set of single component taxcodes as described here Tax Withholding Percentage - #27 by Patch
Then two existing withholding tax codes could be combined and applied to line item or invoice as described here Added withholding tax support for purchase invoices - #26 by Patch