It doesn't really matter if the building is constructed. The function imposes a limit, in this case, a prohibition. If it is built, it destroys it.
DestroyTownBuildingToLevel - I am talking about this function.
This function also does not work... In general, this is implemented in my map called "Throne." If you want, take a look; maybe I missed something after all. For now, I have hacked it and completely removed the ability to hire anyone in the tavern.
P.S. My main goal was to prevent taverns from being built in cities.
Throne 1.2
Multiplayer: Господство, Извечное противостояние, Война за Магию, Торговая империя, Анатомия войны, Эксперимент
SingleScenario: Последний Рубеж, Трон, Элиралис, Вернуться домой!, Лабиринты разума
Campaign: Колонизация