26(a)(2) does not apply, the credit allowed under subpart A for any taxable year (determined after application of paragraph (1)) by reason of subparagraph (A) shall not exceed the excess of— (i) the sum of the regular tax liability (as defined in section 26(b)) plus the tax imposed by section 55, over (ii) the sum of the credits allowable under subpart A (other than this section) and section 27 for the taxable year. (C) Carryforward of unused credit If the credit allowable under subsection (a) by reason of subparagraph (A) exceeds the limitation imposed by section 26(a)(1) or subparagraph (B), whichever is applicable, for such taxable year, reduced by the sum of the credits allowable under subpart A (other than this section) for such taxable year, such excess shall be carried to each of the succeeding 20 taxable years to the extent that such unused credit may not be taken into account under subsection (a) by reason of subparagraph (A) for a prior taxable year because of such limitation. (g) Special rules (1) Related parties For purposes of this section— (A) In general All related persons shall be treated as 1 person. (B) Related persons A person shall be treated as related to another person if the relationship between such persons would result in the disallowance of losses under section 267 or 707(b). (2) Basis For purposes of this subtitle, the basis of any investment with respect to which a credit is allowable under this section shall be reduced by the amount of such credit so allowed. This subsection shall not apply for purposes of sections 1202, 1397B, and 1400B. (3) Recapture The Secretary shall, by regulations, provide for recapturing the benefit of any credit allowable under subsection (a) with respect to any qualified equity investment which is held by the taxpayer less than 3 years, except that no benefit shall be recaptured in the case of— (A) transfer of such investment by reason of the death of the taxpayer, (B) transfer between spouses, (C) transfer incident to the divorce (as defined in section