The Cook Islands has a pleasantly even climate year round, with no excesses of temperature or humidity, although it can rain quite often. The best times of year to visit are around September and October, when there’s a nice trade-off between warm temperatures and reduced humidity; March and April are also good months to come, as the cyclone season has passed and the skies are likely to be clear and sunny.
Festivals may sway your plans: the big dance competition is in late April, the independence bash in early August. The only really tricky time to visit is Christmas/New Year, when many Cook Islanders return home to celebrate the holiday season with their families. Flights (especially from Australia and New Zealand) and accommodation will be much harder to come by.