One can use
org-entry-is-done-p to check whether a headline is locally done:
(defun org-entry-is-done-p () (member (org-get-todo-state) org-done-keywords))
So for example
Task B is considered "done" using this methodology:
* Task A ** COMPLETE Task B CLOSED: [2021-03-08 Mon 15:51] *** Task C
Question: How can one modify this function that it will consider
Task C also done? That is, how can one make a function that checks whether the current headline or any of its parents is done?