this is a very interesting question and I must say that there was a lot of discussion around capitalizing borrowing cost on leasehold improvement.
IAS 23 defines qualifying asset as an asset that takes a substantial period of time to get ready for its intended use or sale.
However, if your asset would be put out of operation during the modernization and modernization would change its use (purpose, functionality, capacity, whatever), then these costs could be capitalized as the asset would be qualifying.
Hope this helps!