The attribute in question depends on the skill you declare, not the weapon you use. If the weapon dictates otherwise, it will say so explicitly (e.g. technical weapons uses WIP when declared using BS Attack skill). CC Attack using a pistol as close combat weapon will thus always uses the CC attribute and never BS. Since the weapon's DAM is a fixed number and not PH, the DAM value of the attack will be the fixed number.
To hit with a pistol as a cc weapon, you use the CC stat. You just use the WEAPON'S damage instead of your phys. While you CAN use MA skills to gain a bonus to your cc skill to-hit (gun-fu), any bonus to damage is wasted (because those mods specify PHYS) though.