The rainiest season in Madagascar is around January to April or May, with June to October being delightful, and rains starting up again in October and bringing filth and humidity back for October through to December/January.
The hottest time of the year is December and January.
The coolest time of the year is June and July.
The best time to come weather-wise is May through October, and for cost-wise travel, the low tourists seasons are the same as anywhere else in the world where Europeans visit. Come outside the normal European tourist seasons for lowest prices.
The north and northeast of Madagascar was sweltering hot humidity in November, December, and January, and it may feels like you can never take enough showers at that time.