The way to decrease the per-unit cost of the F-35 is to guarantee more purchases. The final number of aircraft has decreased dramatically over time. If you divide the development costs over fewer airplanes, each one will cost more.
The second way to lower the cost would be to change government procurement to allow multi-year budgets. If there was a secure, ongoing source of funding, the program could run more smoothly and cost less.
The easiest way to save cost is to build something the right the first time and not change the design and/or requirements every year or two. JSF studies started in 1993, was awarded to Lockheed Martin in 2001 after competition testing and 16 years later it’s still in test.