In general Following a determination by the Secretary under section 45U(d)(1) that the greenhouse gas emissions from transportation fuel produced and sold at retail annually in the United States are equal to or less than 50 percent of the greenhouse gas emissions from transportation fuel produced and sold at retail in the United States during calendar year 2019, the amount of the credit allowed under this section for any new qualified plug-in electric drive motor vehicle sold or qualified 2- or 3-wheeled plug-in electric vehicle acquired during a calendar year described in paragraph (2) shall be equal to the product of— (A) the amount of the credit determined under subsection (a) without regard to this subsection, multiplied by (B) the phase-out percentage under paragraph (2). (2) Phase-out percentage The phase-out percentage under this paragraph is equal to— (A) for a vehicle sold or acquired during the first calendar year following the calendar year in which the determination described in paragraph (1) is made, 75 percent, (B) for a vehicle sold or acquired during the second calendar year following such determination year, 50 percent, (C) for a vehicle sold or acquired during the third calendar year following such determination year, 25 percent, and (D) for a vehicle sold or acquired during any calendar year subsequent to the year described in subparagraph (C), 0 percent. . (d) Second generation biofuel producer credit (1) In general Section 40(b)(6)(J)(i) is amended by striking 2018 and inserting 2021 . (2) Effective date The amendments made by this subsection shall apply to qualified second generation biofuel production after December 31, 2017. (e) Biodiesel and renewable diesel used as fuel (1) In general Section 40A(g) is amended by striking 2017 and inserting 2020 . (2) Effective date The amendments made by this subsection shall apply to fuel sold or used after December 31, 2017. (f) Credit for biodiesel and alternative fuel mixtures (1) In general Section 6426 is amended— (A) in subsection (c)(6), by