Highlight pawns within a range

Thanks for that tutorial! How would I implement it just for a limited time and place?