This applies to all weapons with the defending property. This question assumes you transfer ALL of the enhancement bonus.
Weapons have access to a property called defending which lets you use switch between using the weapons enhancement value towards AC instead of on attack rolls and damage.
So my question is, when you use the defending property for AC, the weapons are still enhanced but not longer providing that bonus towards the attack roll and damage, does the masterwork bonus kicks back in for the attack roll?
A defending weapon allows the wielder to transfer some or all of the weapon's enhancement bonus to his AC as a bonus that stacks with all others.
A masterwork weapon is a finely crafted version of a normal weapon. Wielding it provides a +1 enhancement bonus on attack rolls. You can't add the masterwork quality to a weapon after it is created; it must be crafted as a masterwork weapon (see the Craft skill). The masterwork quality adds 300 gp to the cost of a normal weapon (or 6 gp to the cost of a single unit of ammunition). Adding the masterwork quality to a double weapon costs twice the normal increase (+600 gp).
All magic weapons are automatically considered to be of masterwork quality. The enhancement bonus granted by the masterwork quality doesn't stack with the enhancement bonus provided by the weapon's magic.