When an increase in residential density pursuant to N.J.S.A. 40:55D-70d(5) (known as a density variance) has been approved, developers shall be required to pay a development fee of 6% of the equalized assessed value for each additional unit that may be realized, except that this provision shall not be applicable to a development that will include a set-aside of affordable housing units. However, if the zoning on a site has changed during the two-year period preceding the filing of such a variance application, the base density for the purposes of calculating the bonus development fee shall be the highest density permitted by right during the two-year period preceding the filing of the variance application.