Tim Cook gave himself a sizable slap on the wrist this past summer, docking himself $4 million in pay for Apple's underperforming stock price.

Apple's board decided this past year to align its CEO's pay with the company's performance. If the company performs better than the other stocks in the S&P 500 stock index, the CEO takes home more. If Apple's stock performs worse than the index, Cook takes home less. And if Apple (AAPL) performs much worse, Cook would take home much less.

In a preliminary proxy statement filed on Sunday, Apple said its compensation committee didn't want to place too heavy a burden on Cook. The committee only wanted less than half of Cook's annual stock grants to be subject to the new performance-based metric. At Cook's urging, however, the committee placed half of his stock grants at risk.

His decision was made out of a "strong desire to set a leadership example in the area of CEO compensation and governance," Apple said in its filing.

Related: Tech's highest paid CEOs

Since Apple's shares performed so poorly last year, Cook lost the entire 50% that was at risk. Apple's stock fell 26% between August 2012 and August 2013 (Cook's stocks vest each August), but the S&P 500 rose 18% during that same period.

That 50% that Cook forfeited was worth nearly $4 million.

But Cook still took home quite a bit of money last year. He collected $1.4 million in salary, a $2.8 million cash bonus and another $36.4 million in stock grants. So the $4 million pay cut represented just 10% of his overall compensation last year.

Apple's stock has rebounded lately, actually outperforming the S&P 500 since August. If the stock keeps up its pace, Cook will likely keep all 40,000 shares that are scheduled to vest in August 2014. At today's value, those shares will be worth $22.4 million.