During the Fourth Anglo-Dutch War (1780-1784), he was taken prisoner and held in Madras, where he witnessed the struggle between the British army and Hyder Ali, the Sultan and "de facto" ruler of the Kingdom of Mysore, and the famine that crippled the city in 1782.