Setting Custom Affiliate Commissions for a Portion of Each Subscription Transaction

Happy New Year to All! Is there a way we can set a custom commission for a portion of each subscription transaction?

For Example: Our monthly service includes ad spend which we pay directly to Google or Facebook. So if we charge $1,500/month and $1,000 is ad spend, we can only pay commission on the $500 remaining for management fees. If we pay affiliates 10%, they can only receive $50 (not $150). That said, all clients have custom packages based on budget and services included.

Does anyone know how we can set this up or get around the current settings provided? Or please refer someone who can help us create something to allow for this option?

Thank you in advance!