Hey @jimbojambo303!
I imagine you just want to get the average of the 5 last matches regardless of the game mode:
$(eval m=$(urlfetch json https://api.tracker.gg/api/v2/warzone/matches/atvi/angell%234177009).data.matches; m.length=5; r=m.map(m=>m.attributes.avgKd.kd); a=Math.floor((r.reduce((a,b)=>a+b)/5)*100)/100; `Last 5 lobby KDs: ${r.join(' | ')}. Average lobby KD: ${a}`)
Basically, I first pull all the matches from the API, then only keep the last 5 matches, after that I get the KD for each match, then I compute the average KD and round it to two decimal places.