So if these fields are filled, then we do not need mandatory or not-mandatory activation right?
Correct, it should still calculate tax based off location as long as cb_subs_inv_address_country is filled. There's no internal checks that I can see that mandate the invoice address to be enabled. It's just entirely checking those profile fields directly. So how those fields get filled can be entirely up to you. You could for example completely turn off the invoice address fields and populate cb_subs_inv_address_country from your own field using CB Core Fields Ajax.
Can you please advise regarding the creation of auto action?
Is onCPayBeforeDrawSubscription a good trigger for this?
I'd probably just do them during registration and profile edit to synchronize them when necessary. For existing users you can just run a 1 time database query to synchronize them and then future profile edits/registrations will always synchronize. The below should work fine for this.
Global
Triggers: onAfterUpdateUser, onAfterUserUpdate, onAfterUserRegistration, onAfterNewUser
Type: Field
User: Automatic
Access: Everybody
Conditions
Field: Custom > Value
Custom Value: [var1_YOUR_FIELD_HERE]
Operator: Not Equal To
Value: [var3_YOUR_FIELD_HERE]
Action
Field: cb_subs_inv_address_country
Operator: Set
Value: [YOUR_FIELD_HERE]
Replace YOUR_FIELD_HERE with the name of your country field (e.g. cb_country). The condition is to ensure it only synchronizes when that field changes as you don't want to do saves when not necessary. The above covers both frontend and backend registrations and user edits.
As for the query to quickly 1 time synchronize everyone the below should work. Be sure to replace PREFIX_ with whatever your database table prefix is.
Code:
UPDATE `PREFIX_comprofiler` SET `cb_subs_inv_address_country` = `YOUR_FIELD_HERE`
Now just turn off invoice address entirely and you're done. You won't have to bother your users for that during payments as it'll just use their profile field for it. If you need to synchronize more than country let me know and can provide adjustments to the above auto action to cover multiple fields, but in short you'd add OR conditions for those other fields to check for value changes then under Action add more field rows for them.