12022.5.
(a)
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 three, four, or five years, unless use of a firearm is an element of 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.
(2)
Notwithstanding subdivision (a), any person who personally uses an assault weapon, as specified in Section 12276, 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 five 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 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)
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)
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)
For purposes of imposing an enhancement under Section 1170.1, the enhancements under this section shall count as one, single enhancement.