12022.5.
(a) Except as provided in subdivision (b), subdivisions (b) and (c), any person who personally uses a firearm in the commission or attempted commission of a felony or attempted felony shall shall, upon conviction of that felony or attempted felony, in addition and consecutive to the punishment prescribed for the felony or attempted felony of which he or she has been convicted, be punished by an additional and consecutive term of imprisonment in the state prison for 3, 4, three, four, or 10 five years, unless use of a firearm is an element of that offense. the offense of which he or she was convicted. However, if the person has been convicted of carjacking or attempted carjacking, the additional term shall be four, five, or six years. The court shall order imposition of the middle term unless there are circumstances in aggravation or mitigation. The court shall state its reasons for its enhancement choice on the record at the time of sentencing. (b) (1) Notwithstanding subdivision (a), any person who is convicted of a felony or an attempt to commit a felony, including murder or attempted murder, in which that person discharged a firearm at an occupied motor vehicle which caused great bodily injury or death to the person of another, shall, upon conviction of that felony or attempted felony, in addition and consecutive to the sentence prescribed for the felony or attempted felony, be punished by an additional term of imprisonment in the state prison for five years.
(b) (2) Notwithstanding subdivision (a), any person who personally uses an assault weapon, as specified in Section 30510 12276, or 30515, or a machinegun, as defined in Section 16880, 12200, in the commission of a or attempted commission of a felony, shall, upon conviction of that felony or attempted felony, shall in addition and consecutive to the sentence prescribed for the felony or attempted felony, be punished by an additional and consecutive term of imprisonment in the state prison for 5, 6, or 10 years. five years.
(c) The court may, in the interest of justice pursuant to Section 1385 and at the time of sentencing, strike or dismiss an enhancement otherwise required to be imposed by this section. The authority provided by this subdivision applies to any resentencing that may occur pursuant to any other law. Notwithstanding the enhancement set forth in subdivision (a), any person who personally uses a firearm in the commission or attempted commission of a violation of Section 11351, 11351.5, 11352, 11366.5, 11366.6, 11378, 11378.5, 11379, 11379.5, or 11379.6 of the Health and Safety Code, shall, upon conviction of that offense and in addition and consecutive to the punishment prescribed for the offense of which he or she has been convicted, be punished by an additional term of imprisonment in the state prison for three, four, or five years in the court’s discretion. The court shall order the imposition of middle term unless there are circumstances in aggravation or mitigation. The court shall state the reasons for its enhancement choice on the record.
(d) Notwithstanding the limitation in subdivision (a) relating to being an element of the offense, the The additional term provided by this section shall may be imposed for any violation of Section 245 if a firearm is used, or for in cases of assault with a firearm under paragraph (2) of subdivision (a) of Section 245, or assault with a deadly weapon which is a firearm under Section 245, or murder if the killing is was 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, machinegun in the commission or attempted commission of a felony or attempted felony as provided in this section and the firearm, assault weapon, machinegun, or a .50 BMG rifle, or machinegun 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. Section 12028.
(f) For purposes of imposing an enhancement under Section 1170.1, the enhancements under this section shall count as one one, single enhancement.