Enhanced filter for tasks

Hi all,

I try to customize an AppleScript by MyGeekDaddy (https://gist.github.com/mygeekdaddy/c542ff8d11cf22f44f02) to my needs. The script filters existing OF tasks and creates text output for further processing/printing.
Currently it filters the tasks like this:

set refDueTaskList to a reference to (flattened tasks where (due date ≥ CurrDate and due date < endDatetxt and completion date is missing value))

I would like to enhance this filter to only include tasks in sub-projects under a certain folder. For example, with this structure

- Project 1
- Project 2

I would like to include all tasks in projects under FOLDER.

Any ideas on how to do this?

Thanks and best regards,