Question on Transaction Tax for BEP20 Token

I’m pretty new to the community, so I’m very sorry for the inexpert way of stating my question.

I’ve started working on a smart contract for BEP20 token concept and I’ve solicited help, but I’m not sure I understand how to include a specific function in the code.

There’s a 10% transaction tax on sale: burn (3%), liquidity (2%), marketing (2%), rewards (1.5%), and charity (1.5%). Instead of the entire 2% of the tokens added to the liquidity project wallet at sale, I’d like half (1%) converted directly into BNB or BUSD in a separate wallet.

I want to avoid the concern holders may have when weighing the value of selling from project wallets because it negatively impacts the price as well as provide a healthier sense of the project liquidity. In this way, if we list on an exchange later or something comes up in the life of the project, I can use money that’s accumulated over time and not hurt the project with larger token transactions.

Is there a way to include this function in the smart contract as part of the buy/sale/transfer tax?

Thank you in advance.

Sorry you haven't gotten an answer on this yet. Your post is well written, but it's not clear what you need help with exactly, and what you've already figured out.

Sorry for the delay. I want to take a percentage of the sale/transfer tax and convert it to BNB as opposed to adding tokens to various project wallets. Basically, it would act as second, immiedate transaction to avoid the accrual of tokens to an additional wallet.

For example, I have $10k in pancakeswap and 1B tokens. There's a 10% sale tax. 2% of it goes to marketing/development. I want half of the marketing tax to be converted at time of sale to BNB/BUSD and 1% in tokens to be added to marketing wallet instead of adding 2% of tokens to one project wallet. I am not sure how to put that into my contract.