James Hamilton, 4th Duke of Hamilton, 1658 - 1712. Statesman