12022.5.
(a) (1) Except as provided in subdivisions (b) and (c), any person who personally uses a firearm in the commission or attempted commission of a felony 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 term of imprisonment in the state prison for 3, 4, or 10 years, unless use of a firearm is an element of the offense of which he or she was convicted.(2) If the person described in paragraph (1) has been convicted of carjacking or attempted carjacking, the additional term shall be 4, 5, or 10 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 5, 6, or 10 years.
(2) Notwithstanding subdivision (a), any person who personally uses an assault weapon, as specified in Section 12276 or Section 12276.1, or a machinegun, as defined in Section 12200, in the commission or attempted commission of a felony, 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 5, 6, or 10 years.
(c) 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 3, 4, or 10 years in the court’s discretion. The court shall order the imposition of the middle term unless there are circumstances in aggravation or mitigation. The court shall state the reasons for its enhancement choice on the record.
(d) The additional term provided by this section may be imposed 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 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) Notwithstanding Section 1385 or any other provision of law, the court shall not strike an allegation under this section or a finding bringing a person within the provisions of this section.
(f) Notwithstanding any other provision of law, probation shall not be granted to, nor shall the execution or imposition of sentence be suspended for, any person found to come within the provisions of this section.
(g) No enhancement described in this section in which it is alleged that a firearm was personally used by the defendant shall be used in plea bargaining as defined in subdivision (b) of Section 1192.7. The prosecution shall plead and prove any allegation that the defendant personally used a firearm and shall not enter into any agreement to strike any allegation that the defendant personally used a firearm.
(h) This section shall apply to any person who is a principal in the commission or attempted commission of a felony if that principal intentionally causes a person to use a firearm, whether or not the principal personally uses a firearm.
(i) When a person is found to have personally used a firearm, an assault weapon, or a machinegun in the commission or attempted commission of a felony as provided in this section and the firearm, assault weapon, 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 Section 12028.
(f)
(j) For purposes of imposing an enhancement under Section 1170.1, the enhancements under this section shall count as one, single enhancement.
(k) Notwithstanding Article 2.5 (commencing with Section 2930) of Chapter 7 of Title 1 of Part 3 or Section 4019 or any other provision of law, the total amount of term reduction credits awarded a defendant upon whom a sentence is imposed pursuant to this section shall not exceed 15 percent of the total term of imprisonment imposed.