If a structure or set of structures devoted to a nonconforming use is damaged or destroyed in any manner, regardless of the cause, to the extent that the cost of restoration to the condition prior to such damage or destruction does not exceed 50% of the cost of constructing the entire structure or set of structures, then such structures or set of structures, when restored, may be devoted to the original nonconforming use, provided that a building permit for such restoration is obtained within 18 months from the date of such damage or destruction and restoration is completed in accordance with the terms of the building permit.