Lena Headey has pulled out the big guns in her custody war -- passing a letter to the judge from the "Game of Thrones" Executive Producer demanding her presence on the set.

Lena and ex-hubby Peter Loughran are in a 'GoT' war over custody of 6-year-old Wylie. Lena is begging the judge to modify the current custody order and allow her to keep the boy in the UK, where she films the show. Peter is dead set against it, claiming it would deny him access to his son.

The current order allows Lena to take the boy to the UK only when she films, and Peter says she should be done shooting and wants Wylie back. So Lena has now brought in the ultimate doctor's note from EP Bernadette Caulfield, who says she must stay in the UK for "possible addition scenes and pick-ups" through February 2017.

It's interesting ... the letter does not say her services are definitely necessary but, as you know, winter is coming, so she has to be on call.

Lena wants to move to the UK permanently, because her family is there and she thinks the schools are better. She also says she's paying Peter $10k a month in child support and he hasn't even seen the child in the last 3 months.