How to get a rebalance strategy with a cost matrix?
Is not very common to find cost functions where there is a cost associated with a correct answer C(b,b) (in your example).

But supposing there is, I think the solution to the classification could be trivial: I could say "All my predictions are 'b'" and in that way, I could have -10 as a cost many times and thus giving me a negative cost (depending on balance, of course).

I did not know the technique for applying cost you mention (rebalance accordingly), but for me, it would be more natural if the objective function changes to have this into account.

The following article talks about a possibility for addressing this (Instead of rebalancing, we should measure the cost sensitive matrix). And with XGBoost!

As far as I know, the cost function of a XGBoost classification can be personalized.

Cost Sensitive Classification

XGBoost change loss function - A related question in DS