There were laws like this in NYC back in the late 70s and early 80s. I never saw the language of the law, but most of my friends knew about it, and quite a few lived in apartment building in Alphabet City that they were rehabbing. They believed that if they lived there long enough (10 years?) and improved the building, it would become theirs. I don’t know if this ever actually happened. Sometimes landlords would wait until all the improvements were made, pay back taxes and kick the squatters out.