(a)
Except as provided in subdivision (b), any person who personally uses a firearm in the commission of a felony or attempted felony shall be punished by an additional and consecutive term of imprisonment in the state prison for 3, 4, or 10 years, unless use of a firearm is an element of that offense.
(b)
Notwithstanding subdivision (a), any person who personally uses an assault weapon, as specified in Section 30510 or Section 30515, or a machinegun, as defined in Section 16880, in the commission of a felony or attempted felony, shall be punished by an additional and consecutive term of imprisonment
in the state prison for 5, 6, or 10 years.
(c)
Notwithstanding Section 1385 or any other provisions of law, the court shall not strike an allegation under this section or a finding bringing a person within the provisions of this section.
(d)
Notwithstanding the limitation in subdivision (a) relating to being an element of the offense, the additional term provided by this section shall be imposed for any violation of Section 245 if a firearm is used, or for murder if the killing is perpetrated by means of shooting a firearm from a motor vehicle, intentionally at another person outside of the vehicle with the intent to inflict great bodily injury or death.
(e)
When a person is found to have personally used a firearm, an assault weapon, a machinegun, or a .50 BMG rifle, in the commission of a felony or attempted felony as provided in this section and the firearm, assault weapon, machinegun,
or a .50 BMG rifle, is owned by that person, the court shall order that the firearm be deemed a nuisance and disposed of in the manner provided in Sections 18000 and 18005.
(f)
For purposes of imposing an enhancement under Section 1170.1, the enhancements under this section shall count as one, single enhancement.