Show amount of missed due date tasks

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

Add a Inline JS query to show the NUMBER of incomplete tasks past their due date, to be added to a callout title section that is automatically recessed showing a tasks codeblock with all the incomplete tasks. Just want it to show ALL tasks that do not have a check(I guess or partial/cancel) that were due BEFORE today, not including today as that would double things I’m currently working on. Just want it in a simple number format to help with rescheduling and knowing when I should go back through to rework tasks. Any help is appreciated greatly!

Things I have tried

Previously have attempted this line from a different post,
$=dv.pages().file.tasks.where(t => t.completed).length
, But it is only for completed tasks, which while nice to have isn’t what I’m looking for. Have also attempted to reconstruct based off tasks documentation to provide what I’m looking for, but I don’t have JS experience and struggled immensely.

This is relevant callout section and Tasks view.

[!todo]- Missed Due Dates

(due before today)
not done
group by recurrence
hide recurrence rule