"Whatever it costs, it doesn't matter" - Conditionals with "whatever"

Solution 1:

Your examples are called exhaustive conditional interrogatives in which “whatever” is an interrogative determinative.

Whatever the motivation, haphazard clinical practice led to death. This is a verbless clause functioning as an adjunct. It comprises an interrogative phrase followed by the subject, with the verb "be" understood: "whatever the motivation was".

We understand that haphazard clinical practices led to death no matter what x was, where x is some unknown motivation.

An 'exhaustive conditional' construction like this uses an interrogative clause to express a set of conditions that exhaustively cover the possibilities. It’s used because the interrogative expresses a question whose answers define an exhaustive set of conditions. The question here is "What was the motivation?" which has an open set of answers.

Whatever it costs, it doesn't matter. The same applies here, except that that the interrogative adjunct clause is not reduced. We understand that for every possible x, where x is the cost, it doesn’t matter", so all possibilities are exhausted. The question here is "what does it cost?" which has an open set of answers.